Highcharts グラフィックhttp://jsfiddle.net/jerryvermanen/XRjyc/がありますが、入力フィールドを追加したいと思います。入力フィールドは年を要求します。入力後:
- グラフィックは、入力年に 1 年を追加する必要があります (したがって、1992 年は 1993 年になります)。
- グラフィックには、入力年 + 1 に垂直なプロット ラインが表示されます (つまり、1993 年のライン)。
- また、その 5 年後 (1998 年)、5 年後 (2003 年) などに線を追加する必要があります。
- また、それらの年 (1993 年、1998 年、2003 年、2008 年、2013 年) のパーセンテージを取り、それらをテキストに追加する必要があります。「あなたは X%、Y%、Z% などを支払います」のように。
もう少し複雑にするために、1992 年 (4,94%)、1993 年 (3,74%)、1994 年 (4,77%)、1996 年 (4,52%)、1997 年 (4,94%) の入力年について説明します。 )、1998 年 (3.74%)、1999 年 (4.77%) の場合、() 間のパーセンテージは 2001 年 3 月 1 日の日付に追加する必要があります。
chart = new Highcharts.Chart({ exporting: { enabled: false }, chart: { renderTo: 'container', type: 'spline', marginRight: 20 }, title: { text: 'Rente DUO' }, subtitle: { text: '' }, xAxis: { type: 'datetime', dateTimeLabelFormats: { // don't display the dummy year month: '%Y', year: '%Y' } }, yAxis: { min:0, title: { text: 'Werkloosheid (%)' }, plotLines: [{ value: 0, width: 2, color: '#000000', zIndex: 5 }, { label: { text: 'Rente DUO', align: 'right' }, value: 5, width: 0.5, color: '#ffffff', zIndex: 1 }] }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'<br/>'+ Highcharts.dateFormat('%b %Y', this.x) +':</b> '+ this.y +'%'; } }, plotOptions: { spline: { lineWidth: 3, states: { hover: { lineWidth: 4 } }, marker: { enabled: false, states: { hover: { enabled: true, symbol: 'circle', radius: 4, lineWidth: 1 } } } } }, legend: { enabled: false },
</p>
これが難しい場合は、年を入力してから新しいグラフを描画することによっても実行できます。このグラフは、同じデータの階段状の折れ線グラフになります。
これはどのように作ることができますか?