@@ -62,8 +62,8 @@ class WeatherChartCard extends LitElement {
6262 ? this . config . units . speed : 'km/h' ;
6363 this . unitPressure = this . config . units && this . config . units . pressure
6464 ? this . config . units . pressure : 'hPa' ;
65- this . chartFontSize = this . config . chart_options && this . config . chart_options . font_size
66- ? this . config . chart_options . font_size : 12 ;
65+ this . chartLabelsFontSize = this . config . chart_options && this . config . chart_options . labels_font_size
66+ ? this . config . chart_options . labels_font_size : 12 ;
6767 this . chartTemperature1Color = this . config . chart_options && this . config . chart_options . temperature1_color
6868 ? this . config . chart_options . temperature1_color : 'rgba(230, 100, 100, 1.0)' ;
6969 this . chartTemperature2Color = this . config . chart_options && this . config . chart_options . temperature2_color
@@ -126,7 +126,7 @@ class WeatherChartCard extends LitElement {
126126 if ( ! card ) {
127127 return ;
128128 }
129- this . forecastItems = Math . round ( card . offsetWidth / ( this . chartFontSize * 5.5 ) ) ;
129+ this . forecastItems = Math . round ( card . offsetWidth / ( this . chartLabelsFontSize * 5.5 ) ) ;
130130 }
131131
132132 drawChart ( { config, language, weather, forecastItems} = this ) {
@@ -165,7 +165,6 @@ class WeatherChartCard extends LitElement {
165165 const ctx = this . renderRoot . querySelector ( '#forecastChart' ) . getContext ( '2d' ) ;
166166
167167 Chart . defaults . color = textColor ;
168- Chart . defaults . font . size = this . chartFontSize ;
169168 Chart . defaults . scale . grid . color = dividerColor ;
170169 Chart . defaults . elements . line . fill = false ;
171170 Chart . defaults . elements . line . tension = 0.3 ;
@@ -287,6 +286,7 @@ class WeatherChartCard extends LitElement {
287286 borderWidth : 1.5 ,
288287 padding : 4 ,
289288 font : {
289+ size : this . chartLabelsFontSize ,
290290 lineHeight : 0.7 ,
291291 } ,
292292 formatter : function ( value , context ) {
0 commit comments