1
このコードは、ユーザープロファイルに表示されているグラフ用です。特定の日付範囲(週、月、年、生涯)の統計を表示するグラフです。どの範囲をデフォルトにしても、目盛りはデータポイントと完全に並んでいます。別の間隔を選択するたびに、ティックはもう整列しません。チャートのC3 APIロード呼び出し後のティックマークにデータが付いていない
初期世代:
this.chartSpline = C3.generate({
bindto: '.splineChart',
colors:'#1BA39C',
data: {
xFormat: '%m-%d-%Y',
columns: [this.columns, this.rows],
type: 'area-spline',
x: 'Date',
},
padding: {
right: 100,
left: 100,
},
axis: {
x: {
type : 'timeseries',
tick:{
fit: true,
count: this.rows.length/2,
format: '%m/%d',
},
padding:{
left:0,
right: 10
}
},
y: {
padding:{
top:50,
bottom: 0
},
label: {
text: 'Minutes played',
position: 'outer-middle'
}
}
},
point: {
r: 8,
},
legend: {
show: false
}
});
上記のコードは1つのバックボーンビューであり、我々は、ロード機能を有する他の骨格図を読み込みます。ユーザーが新しい日付範囲を選択すると、load関数が呼び出されます。
this.plot.load({columns: [columns, rows]});
私に提供できるヘルプがあれば、大歓迎です。ありがとう!