@@ -328,6 +328,7 @@ const model = ref([
328328 { key: ' chart.tooltip.backgroundOpacity' , def: 20 , type: ' range' , min: 0 , max: 100 },
329329 { key: ' chart.tooltip.position' , def: ' center' , type: ' select' , options: [' left' , ' center' , ' right' ]},
330330 { key: ' chart.tooltip.offsetY' , def: 24 , type: ' number' , min: 0 , max: 48 },
331+ { key: ' chart.tooltip.showTimeLabel' , def: true , type: ' checkbox' },
331332
332333 { key: ' bar.borderRadius' , def: 2 , type: ' number' , min: 0 , max: 120 , label: ' borderRadius' , category: ' bar' },
333334 { key: ' bar.useGradient' , def: true , type: ' checkbox' , label: ' useGradient' , category: ' bar' },
@@ -511,23 +512,23 @@ const config = computed(() => {
511512 },
512513 xAxisLabels: {
513514 ... c .chart .grid .labels .xAxisLabels ,
514- values: [
515- " JANUARY IS KIND OF LONG" ,
516- " FEBRUARY IS KIND OF LONG TOO" ,
517- " MARCH" ,
518- " APRIL" ,
519- " MAY" ,
520- " JUNE" ,
521- " JULY" ,
522- " AUGUST" ,
523- " SEPTEMBER" ,
524- " OCTOBER" ,
525- " NOVEMBER IS KIND OF LONG TOO" ,
526- " DECEMBER" ,
527- " JANUARY+" ,
528- " FEBRUARY+" ,
529- " MARCH+"
530- ]
515+ // values: [
516+ // "JANUARY IS KIND OF LONG",
517+ // "FEBRUARY IS KIND OF LONG TOO",
518+ // "MARCH",
519+ // "APRIL",
520+ // "MAY",
521+ // "JUNE",
522+ // "JULY",
523+ // "AUGUST",
524+ // "SEPTEMBER",
525+ // "OCTOBER",
526+ // "NOVEMBER IS KIND OF LONG TOO",
527+ // "DECEMBER",
528+ // "JANUARY+",
529+ // "FEBRUARY+",
530+ // "MARCH+"
531+ // ]
531532 }
532533 }
533534 }
@@ -563,6 +564,10 @@ function selectX(selectedX) {
563564// resizeObserver.observe(resizable.value)
564565// })
565566
567+ function selectTimeLabel (data ) {
568+ console .log (data)
569+ }
570+
566571 </script >
567572
568573<template >
@@ -586,7 +591,31 @@ function selectX(selectedX) {
586591 <LocalVueUiXy component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" {
587592 ...config,
588593 responsive: true,
589- }" >
594+ }" @selectTimeLabel =" selectTimeLabel" >
595+
596+ <template #time-label =" {x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
597+ <g @click =" () => selectTimeLabel({x, y, fontSize, absoluteIndex })" >
598+ <text
599+ :x =" x"
600+ :y =" y"
601+ :font-size =" fontSize"
602+ :text-anchor =" textAnchor"
603+ :fill =" fill"
604+ >
605+ {{ content }}
606+ </text >
607+ <text
608+ :x =" x"
609+ :y =" y + fontSize"
610+ :font-size =" fontSize * 0.8"
611+ :text-anchor =" textAnchor"
612+ fill =" grey"
613+ >
614+ {{ content }}
615+ </text >
616+ </g >
617+ </template >
618+
590619 <template #plot-comment =" { plot } " >
591620 <div :style =" `font-size: 12px; color:${plot.color}; text-align:center`" >
592621 {{ plot.comment }}
@@ -616,6 +645,28 @@ function selectX(selectedX) {
616645 <circle :cx="svg.width / 2" :cy="svg.height / 2" :r="30" fill="#42d392" />
617646 <text :x="svg.width / 2" :y="svg.height / 2" text-anchor="middle">#SVG</text>
618647 </template> -->
648+ <template #time-label =" {x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
649+ <g @click =" () => selectTimeLabel({x, y, fontSize, absoluteIndex })" >
650+ <text
651+ :x =" x"
652+ :y =" y"
653+ :font-size =" fontSize"
654+ :text-anchor =" textAnchor"
655+ :fill =" fill"
656+ >
657+ {{ content }}
658+ </text >
659+ <text
660+ :x =" x"
661+ :y =" y + fontSize"
662+ :font-size =" fontSize * 0.8"
663+ :text-anchor =" textAnchor"
664+ fill =" grey"
665+ >
666+ {{ content }}
667+ </text >
668+ </g >
669+ </template >
619670 <template #optionPdf >
620671 PRINT PDF
621672 </template >
@@ -648,6 +699,29 @@ function selectX(selectedX) {
648699 <template #VDUI-local >
649700 <LocalVueDataUi component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset: dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `VDUI-lodal_${step}`"
650701 @selectLegend =" selectLegend" @selectX =" selectX" ref =" vduiLocal" >
702+ <template #time-label =" {x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
703+ <g @click =" () => selectTimeLabel({x, y, fontSize, absoluteIndex })" >
704+ <text
705+ :x =" x"
706+ :y =" y"
707+ :font-size =" fontSize"
708+ :text-anchor =" textAnchor"
709+ :fill =" fill"
710+ >
711+ {{ content }}
712+ </text >
713+ <text
714+ :x =" x"
715+ :y =" y + fontSize"
716+ :font-size =" fontSize * 0.8"
717+ :text-anchor =" textAnchor"
718+ fill =" grey"
719+ >
720+ {{ content }}
721+ </text >
722+ </g >
723+ </template >
724+
651725 <template #svg =" { svg } " >
652726 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
653727 <text :x =" svg.width / 2" :y =" svg.height / 2" text-anchor =" middle" >#SVG</text >
@@ -678,6 +752,28 @@ function selectX(selectedX) {
678752 <template #build >
679753 <VueUiXy :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `build_${step}`" @selectLegend =" selectLegend"
680754 @selectX =" selectX" ref =" build" >
755+ <template #time-label =" {x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
756+ <g @click =" () => selectTimeLabel({x, y, fontSize, absoluteIndex })" >
757+ <text
758+ :x =" x"
759+ :y =" y"
760+ :font-size =" fontSize"
761+ :text-anchor =" textAnchor"
762+ :fill =" fill"
763+ >
764+ {{ content }}
765+ </text >
766+ <text
767+ :x =" x"
768+ :y =" y + fontSize"
769+ :font-size =" fontSize * 0.8"
770+ :text-anchor =" textAnchor"
771+ fill =" grey"
772+ >
773+ {{ content }}
774+ </text >
775+ </g >
776+ </template >
681777 <template #svg =" { svg } " >
682778 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
683779 <text :x =" svg.width / 2" :y =" svg.height / 2" text-anchor =" middle" >#SVG</text >
@@ -708,6 +804,28 @@ function selectX(selectedX) {
708804 <template #VDUI-build >
709805 <VueDataUi component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `VDUI-build_${step}`"
710806 @selectLegend =" selectLegend" @selectX =" selectX" ref =" vduiBuild" >
807+ <template #time-label =" {x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
808+ <g @click =" () => selectTimeLabel({x, y, fontSize, absoluteIndex })" >
809+ <text
810+ :x =" x"
811+ :y =" y"
812+ :font-size =" fontSize"
813+ :text-anchor =" textAnchor"
814+ :fill =" fill"
815+ >
816+ {{ content }}
817+ </text >
818+ <text
819+ :x =" x"
820+ :y =" y + fontSize"
821+ :font-size =" fontSize * 0.8"
822+ :text-anchor =" textAnchor"
823+ fill =" grey"
824+ >
825+ {{ content }}
826+ </text >
827+ </g >
828+ </template >
711829 <template #svg =" { svg } " >
712830 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
713831 <text :x =" svg.width / 2" :y =" svg.height / 2" text-anchor =" middle" >#SVG</text >
0 commit comments