@@ -432,7 +432,7 @@ const model = ref([
432432
433433 { key: ' chart.grid.labels.show' , def: true , type: ' checkbox' , label: ' showLabels' , category: ' grid' },
434434 { key: ' chart.grid.labels.color' , def: ' #1A1A1A' , type: ' color' , label: ' textColor' , category: ' grid' },
435- { key: ' chart.grid.labels.fontSize' , def: 16 , type: ' number' , min: 4 , max: 30 , label: ' fontSize' , category: ' grid' },
435+ { key: ' chart.grid.labels.fontSize' , def: 26 , type: ' number' , min: 4 , max: 30 , label: ' fontSize' , category: ' grid' },
436436 { key: ' chart.grid.labels.axis.yLabel' , def: ' TEST' , type: ' text' , label: ' yAxisLabel' , category: ' grid' },
437437 { key: ' chart.grid.labels.axis.xLabel' , def: ' TEST' , type: ' text' , label: ' xAxisLabel' , category: ' grid' },
438438 { key: ' chart.grid.labels.axis.fontSize' , def: 14 , type: ' number' , min: 4 , max: 30 , label: ' fontSize' , category: ' grid' },
@@ -600,10 +600,49 @@ const size = ref({
600600})
601601
602602const timeValues = computed (() => {
603- const arr = [];
604- for (let i = 0 ; i < 30 ; i += 1 ) {
605- arr .push (` ${ i >= 10 ? i : ' 0' + String (i)} -01-2026` )
603+ const arr = []
604+ const year = 2026
605+
606+ for (let month = 1 ; month <= 12 ; month++ ) {
607+ const daysInMonth = new Date (year, month, 0 ).getDate ()
608+ for (let day = 1 ; day <= daysInMonth; day++ ) {
609+ const dd = String (day).padStart (2 , ' 0' )
610+ const mm = String (month).padStart (2 , ' 0' )
611+ arr .push (` ${ year} -${ mm} -${ dd} ` ) // ISO format
612+ }
613+ }
614+
615+ console .log (arr)
616+
617+ return arr
618+ })
619+
620+ // const monthValues = computed(() => {
621+ // const yearStart = 2026
622+ // const arr = []
623+
624+ // for (let i = 0; i < 13; i++) {
625+ // // monthIndex goes 0→12 (Jan 2026 → Jan 2027)
626+ // const date = new Date(yearStart, i, 1)
627+ // const yyyy = date.getFullYear()
628+ // const mm = String(date.getMonth() + 1).padStart(2, '0')
629+ // const dd = String(date.getDate()).padStart(2, '0') // always "01" here
630+
631+ // arr.push(`${yyyy}-${mm}-${dd}`)
632+ // }
633+
634+ // return arr
635+ // })
636+
637+ const monthValues = computed (() => {
638+ const yearStart = 2026
639+ const arr = []
640+
641+ for (let i = 0 ; i < 13 ; i++ ) {
642+ const d = new Date (yearStart, i, 1 )
643+ arr .push (d .getTime ())
606644 }
645+
607646 return arr
608647})
609648
@@ -784,7 +823,21 @@ const config = computed(() => {
784823 },
785824 xAxisLabels: {
786825 ... c .chart .grid .labels .xAxisLabels ,
787- values: timeValues .value
826+ values: monthValues .value ,
827+ datetimeFormatter: {
828+ enable: true ,
829+ locale: ' en' ,
830+ useUTC: false ,
831+ januaryAsYear: true ,
832+ options: {
833+ year: ' yyyy' ,
834+ month: ` MMM` ,
835+ day: ' dd MMM' ,
836+ hour: ' HH:mm' ,
837+ minute: ' HH:mm:ss' ,
838+ second: ' HH:mm:ss'
839+ }
840+ }
788841 }
789842 }
790843 }
0 commit comments