Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 354: | Rivi 354: | ||
memo.showTrend = ( jQuery( this ).attr( 'data-show-trend' ) != 'false' ); | memo.showTrend = ( jQuery( this ).attr( 'data-show-trend' ) != 'false' ); | ||
memo.trendType = jQuery( this ).attr( 'data-trend-type' ); if (typeof memo.trendType == 'undefined') { memo.trendType = i18n[memo.obscode]['trend']['type']; } | memo.trendType = jQuery( this ).attr( 'data-trend-type' ); if (typeof memo.trendType == 'undefined') { memo.trendType = i18n[memo.obscode]['trend']['type']; } if (typeof memo.trendType == 'undefined') { memo.trendType = 'smart'; } | ||
memo.jw = new jwApi(); | memo.jw = new jwApi(); | ||
| Rivi 1 038: | Rivi 1 038: | ||
// series for trend line | // series for trend line | ||
if ( memo.showTrend ) { | if ( memo.showTrend ) { | ||
if ( memo.summerwinter ) { | if ( memo.summerwinter ) { | ||
memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['summer'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: 'polynomial', 'degree': 2, visibleInLegend: false }; | memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['summer'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: 'polynomial', 'degree': 2, visibleInLegend: false }; | ||
| Rivi 1 044: | Rivi 1 045: | ||
memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['trend'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: 'polynomial', 'degree': 2, visibleInLegend: memo.trendType!='moving' }; | memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['trend'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: 'polynomial', 'degree': 2, visibleInLegend: memo.trendType!='moving' }; | ||
} | } | ||
if ( memo.trendType = 'smart' ) { | |||
if ( memo.axisMaxDate.getFullYear() - memo.axisMinDate.getFullYear() > 10 ) && ) { | |||
for ( var t in memo.options.trendlines ) { | |||
memo.options.trendlines[ t ].type = 'polynomial'; | |||
memo.options.trendlines[ t ].degree = 2; | |||
} | |||
} else { | |||
memo.options.trendlines[ t ].type = 'linear'; | |||
} | |||
} else { | |||
ttype = memo.trendType; | |||
tdegree = memo | |||
} | |||
} | } | ||


