@@ -87,26 +87,89 @@ function createDs(n, m = 100) {
8787// },
8888// })
8989
90+ // const dataset = ref([
91+ // {
92+ // name: "Curved",
93+ // series: createDs(12),
94+ // type: "line",
95+ // smooth: true,
96+ // useArea: true,
97+ // useTag: 'start',
98+ // dataLabels: false,
99+ // autoScale: true
100+ // },
101+ // {
102+ // name: "Curved",
103+ // series: createDs(12),
104+ // type: "line",
105+ // smooth: false,
106+ // useArea: true,
107+ // useTag: 'end',
108+ // dataLabels: false,
109+ // },
110+ // ])
111+
90112const dataset = ref ([
91113 {
92- name: " Curved " ,
93- series: createDs ( 12 ) ,
114+ name: " A " ,
115+ series: [ null , 100 , 112 , 221 , 119 , 75 , null , 226 , 243 , 198 , 156 , 127 , null ] ,
94116 type: " line" ,
95- smooth: true ,
96- useArea: true ,
97- useTag: ' start' ,
98117 dataLabels: false ,
99- autoScale: true
100118 },
101119 {
102- name: " Curved " ,
103- series: createDs ( 12 ) ,
120+ name: " B " ,
121+ series: [ null , 75 , 119 , 201 , 109 , 85 , null , 206 , 223 , 204 , 146 , 117 , null ] ,
104122 type: " line" ,
105- smooth: false ,
106- useArea: true ,
107- useTag: ' end' ,
108123 dataLabels: false ,
109124 },
125+ // {
126+ // name: "A",
127+ // series: [null, 100, 112, 221, 119, 75, 213, 226, 243, 198, 156, 127, null],
128+ // type: "bar",
129+ // dataLabels: false,
130+ // },
131+ // {
132+ // name: "B",
133+ // series: [null, 75, 119, 201, 109, 85, 203, 206, 223, 204, 146, 117, null],
134+ // type: "bar",
135+ // dataLabels: false,
136+ // },
137+ // {
138+ // name: "A",
139+ // series: [null, 100, 112, 221, 119, 75, 213, 226, 243, 198, 156, 127, null],
140+ // type: "bar",
141+ // dataLabels: false,
142+ // },
143+ // {
144+ // name: "B",
145+ // series: [null, 75, 119, 201, 109, 85, 203, 206, 223, 204, 146, 117, null],
146+ // type: "bar",
147+ // dataLabels: false,
148+ // },
149+ // {
150+ // name: "A",
151+ // series: [null, 100, 112, 221, 119, 75, 213, 226, 243, 198, 156, 127, null],
152+ // type: "bar",
153+ // dataLabels: false,
154+ // },
155+ // {
156+ // name: "B",
157+ // series: [null, 75, 119, 201, 109, 85, 203, 206, 223, 204, 146, 117, null],
158+ // type: "bar",
159+ // dataLabels: false,
160+ // },
161+ // {
162+ // name: "A",
163+ // series: [null, 100, 112, 221, 119, 75, 213, 226, 243, 198, 156, 127, null],
164+ // type: "bar",
165+ // dataLabels: false,
166+ // },
167+ // {
168+ // name: "B",
169+ // series: [null, 75, 119, 201, 109, 85, 203, 206, 223, 204, 146, 117, null],
170+ // type: "bar",
171+ // dataLabels: false,
172+ // },
110173])
111174
112175// const dataset = ref([
@@ -290,6 +353,8 @@ function toggleProps() {
290353const model = ref ([
291354 { key: ' locale' , def: ' ' , type: ' select' , options: [' ' , ' en-US' , ' en-GB' , ' fr-FR' , ' de-DE' , ' ar-SA' ] },
292355 { key: ' responsive' , def: false , type: ' checkbox' },
356+ { key: ' responsiveProportionalSizing' , def: false , type: ' checkbox' },
357+
293358 { key: ' chart.userOptions.show' , def: true , type: ' checkbox' , label: ' showUserOptions' , category: ' general' },
294359 { key: ' chart.userOptions.buttons.pdf' , def: true , type: ' checkbox' },
295360 { key: ' chart.userOptions.buttons.csv' , def: true , type: ' checkbox' },
@@ -317,7 +382,7 @@ const model = ref([
317382 { key: ' chart.zoom.enableRangeHandles' , def: true , type: ' chexkbox' },
318383 { key: ' chart.zoom.enableSelectionDrag' , def: true , type: ' checkbox' },
319384
320- { key: ' chart.zoom.minimap.show' , def: true , type: ' checkbox' },
385+ { key: ' chart.zoom.minimap.show' , def: false , type: ' checkbox' },
321386 { key: ' chart.zoom.minimap.smooth' , def: true , type: ' checkbox' },
322387 { key: ' chart.zoom.minimap.selectedColor' , def: ' #1f77b4' , type: ' color' },
323388 { key: ' chart.zoom.minimap.selectedColorOpacity' , def: 0.2 , type: ' range' , min: 0 , max: 1 , step: 0.01 },
@@ -380,21 +445,25 @@ const model = ref([
380445 { key: ' chart.grid.labels.xAxisLabels.rotation' , def: 0 , type: ' range' , min: - 360 , max: 360 , label: ' rotation' , category: ' grid' },
381446 { key: ' chart.grid.labels.axis.xLabelOffsetY' , def: 24 , type: ' number' , min: - 100 , max: 100 },
382447
383- { key: ' chart.grid.labels.xAxisLabels.showOnlyAtModulo' , def: true , type: ' checkbox' },
448+ { key: ' chart.grid.labels.xAxisLabels.showOnlyAtModulo' , def: false , type: ' checkbox' },
384449 { key: ' chart.grid.labels.xAxisLabels.modulo' , def: 6 , type: ' number' },
385450
386451 { key: ' chart.grid.labels.yAxis.position' , def: ' right' , type: ' select' , options: [' left' , ' right' ] },
387452 { key: ' chart.grid.labels.yAxis.commonScaleSteps' , def: 10 , min: 0 , max: 100 , type: ' number' },
388- { key: ' chart.grid.labels.yAxis.useIndividualScale' , def: true , type: " checkbox" },
453+ { key: ' chart.grid.labels.yAxis.useIndividualScale' , def: false , type: " checkbox" },
389454 { key: ' chart.grid.labels.yAxis.stacked' , def: false , type: ' checkbox' },
390455 { key: ' chart.grid.labels.yAxis.gap' , def: 12 , min: 0 , max: 200 , type: ' number' },
391456 { key: ' chart.grid.labels.yAxis.labelWidth' , def: 48 , min: 0 , max: 100 , type: ' number' },
392457 { key: ' chart.grid.labels.yAxis.showBaseline' , def: true , type: ' checkbox' },
393- { key: ' chart.grid.labels.yAxis.scaleMin' , def: - 90 , type: ' number' , min: - 1000 , max: 1000 },
394- { key: ' chart.grid.labels.yAxis.scaleMax' , def: 90 , type: ' number' , min: - 1000 , max: 1000 },
458+ { key: ' chart.grid.labels.yAxis.scaleMin' , def: null , type: ' number' , min: - 1000 , max: 1000 },
459+ { key: ' chart.grid.labels.yAxis.scaleMax' , def: null , type: ' number' , min: - 1000 , max: 1000 },
395460 { key: ' chart.grid.labels.yAxis.groupColor' , def: ' #1A1A1A' , type: ' color' },
396461 { key: ' chart.grid.labels.yAxis.scaleLabelOffsetX' , def: 36 , type: ' number' , min: - 100 , max: 100 },
397462 { key: ' chart.grid.labels.yAxis.scaleValueOffsetX' , def: - 20 , type: ' number' , min: - 100 , max: 100 },
463+ { key: ' chart.grid.labels.yAxis.useNiceScale' , def: true , type: ' checkbox' },
464+
465+ { key: ' chart.grid.labels.yAxis.showCrosshairs' , def: true , type: ' checkbox' },
466+ { key: ' chart.grid.labels.xAxis.showCrosshairs' , def: true , type: ' checkbox' },
398467
399468 { key: ' chart.grid.labels.xAxis.showBaseline' , def: true , type: ' checkbox' },
400469 { key: ' chart.grid.labels.zeroLine.show' , def: true , type: ' checkbox' },
@@ -446,7 +515,7 @@ const model = ref([
446515 { key: ' bar.serieName.abbreviationSize' , def: 3 , type: ' number' , min: 0 , max: 12 , label: [' serieName' , ' abbreviation' , ' is' , ' size' ], category: ' bar' },
447516 { key: ' bar.serieName.useSerieColor' , def: true , type: ' checkbox' , label: [' serieName' , ' textColor' , ' is' , ' series' ], category: ' bar' },
448517 { key: ' bar.serieName.color' , def: ' #1A1A1A' , type: ' color' , label: [' serieName' , ' is' , ' textColor' ], category: ' bar' },
449- { key: ' bar.periodGap' , def: 0.1 , type: ' number' , min: 0 , max: 24 },
518+ { key: ' bar.periodGap' , def: 0.01 , type: ' number' , min: 0 , max: 24 },
450519 { key: ' bar.border.useSerieColor' , def: false , type: ' checkbox' },
451520 { key: ' bar.border.stroke' , def: ' #FFFFFF' , type: ' color' },
452521 { key: ' bar.border.strokeWidth' , def: 1 , type: ' number' , min: 0 , max: 12 , step: 0.5 },
@@ -507,7 +576,8 @@ const model = ref([
507576 { key: ' chart.userOptions.print.allowTaint' , def: true , type: ' checkbox' },
508577 { key: ' chart.userOptions.print.backgroundColor' , def: ' #FFFFFF' , type: ' color' },
509578 { key: ' chart.userOptions.print.useCORS' , def: true , type: ' checkbox' },
510- { key: ' chart.userOptions.print.scale' , def: 2 , type: ' number' , min: 1 , max: 5 }
579+ { key: ' chart.userOptions.print.scale' , def: 2 , type: ' number' , min: 1 , max: 5 },
580+
511581]);
512582
513583const testCustomTooltip = ref (false );
@@ -600,6 +670,46 @@ const config = computed(() => {
600670 chart: {
601671 ... c .chart ,
602672 // Attempt a scale groups
673+ annotations: [
674+ {
675+ show: true ,
676+ yAxis: {
677+ yTop: 125 ,
678+ yBottom: 70 ,
679+ label: {
680+ text: ' average' ,
681+ textAnchor: ' start' , // or end
682+ position: ' start' , // or end
683+ offsetY: 0 ,
684+ offsetX: 0 ,
685+ border: {
686+ stroke: ' #FF0000' ,
687+ strokeWidth: 1 ,
688+ rx: 0 ,
689+ ry: 0
690+ },
691+ padding: {
692+ top: 5 ,
693+ right: 10 ,
694+ bottom: 5 ,
695+ left: 10
696+ },
697+ fontSize: 14 ,
698+ color: ' #1A1A1A' ,
699+ backgroundColor: ' #E1E5E8'
700+ },
701+ line: {
702+ stroke: ' #1A1A1A' ,
703+ strokeWidth: 1 ,
704+ strokeDasharray: 2 ,
705+ },
706+ area: {
707+ fill: ' #E1E5E8' ,
708+ opacity: 50
709+ }
710+ }
711+ }
712+ ],
603713 scaleGroups: {
604714 enabled: true ,
605715 groups: [
@@ -609,6 +719,17 @@ const config = computed(() => {
609719 },
610720 userOptions: {
611721 ... c .chart .userOptions ,
722+ callbacks: {
723+ img : (b64 ) => {
724+ console .log (b64)
725+ },
726+ csv : (xls ) => {
727+ console .log (xls)
728+ },
729+ pdf : (chart ) => {
730+ console .log (chart)
731+ }
732+ },
612733 print: {
613734 ... c .chart .userOptions .print ,
614735 // onclone: (doc) => {
@@ -728,7 +849,7 @@ function selectTimeLabel(data) {
728849 responsive: true,
729850 }" @selectTimeLabel =" selectTimeLabel" >
730851
731- <template #pattern =" { seriesIndex , patternId } " >
852+ <!-- < template #pattern="{ seriesIndex, patternId }">
732853 <pattern v-if="seriesIndex === 0" :id="patternId" width="70" height="8" patternTransform="scale(2)"
733854 patternUnits="userSpaceOnUse" opacity="0.5">
734855 <rect width="100%" height="100%" fill="#FFFFFF20" />
@@ -750,14 +871,14 @@ function selectTimeLabel(data) {
750871 <path fill="#f44034"
751872 d="M21.63 0 20 1.63v1.54L23.15 0zm3.08 0L20 4.71v1.54L26.25 0zm3.08 0L20 7.79v1.53L29.32 0zm3.07 0L20 10.86v1.54L32.4 0zm3.08 0L20 13.94v1.54L35.48 0zm3.08 0L20 17.02v1.54L38.55 0zM40 .1l-20 20L.1 40h1.53L40 1.63zm0 3.07L3.17 40h1.54L40 4.71zm0 3.08L6.25 40h1.54L40 7.79zm0 3.07L9.32 40h1.54L40 10.86zm0 3.08L12.4 40h1.54L40 13.94zm0 3.08L15.48 40h1.54L40 17.02zm0 3.08L18.55 40h1.55L40 20.1V20zM1.63 20 0 21.63v1.54L3.15 20zm3.08 0L0 24.71v1.54L6.25 20zm3.08 0L0 27.79v1.53L9.32 20zm3.07 0L0 30.86v1.54L12.4 20zm3.08 0L0 33.94v1.54L15.48 20zm3.08 0L0 37.02v1.54L18.55 20zM40 21.63 21.63 40h1.54L40 23.17zm0 3.08L24.71 40h1.54L40 26.25zm0 3.08L27.79 40h1.53L40 29.33zm0 3.08L30.86 40h1.54l7.6-7.6zm0 3.07L33.94 40h1.54L40 35.48zm0 3.08L37.02 40h1.54L40 38.56zM9.32 0l-.8.8v1.54L10.86 0zm2.16.92L8.52 3.88v1.54l2.96-2.96zm0 3.08L8.52 6.96V8.5l2.96-2.96zm0 3.08-1.44 1.44-2.96 2.96h1.44v.1l.1-.1 2.86-2.87.1-.09h-.1zM.8 8.52l-.8.8v1.54l2.34-2.34zm3.08 0L.92 11.48h1.54l2.96-2.96zm3.08 0L4 11.48h1.54L8.5 8.52zm6.16 0-1.64 1.63-1.33 1.33-1.63 1.63v1.54l2.96-2.96v-.21h.21l2.96-2.96zm3.07 0-2.96 2.96h1.54l2.96-2.96zm3.08 0-2.96 2.96h1.53L20 9.32v-.8zm.73 2.34-.62.62H20zm-8.52 2.37-2.96 2.96v1.54l2.96-2.96zm0 3.07-2.96 2.97V40h2.96V20H9.32l2.16-2.16z" />
752873 </pattern>
753- </template >
874+ </template> -->
754875
755876 <!-- <template #chart-background>
756877 <div style="width: 100%; height:100%; background: radial-gradient(at top left, red, white)">
757878 </div>
758879 </template> -->
759880
760- <template #time-label =" { x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
881+ <!-- < template #time-label="{ x, y, fontSize, fill, transform, absoluteIndex, content, textAnchor }">
761882 <g @click="() => selectTimeLabel({ x, y, fontSize, absoluteIndex })">
762883 <text :x="x" :y="y" :font-size="fontSize" :text-anchor="textAnchor" :fill="fill">
763884 {{ content }}
@@ -766,7 +887,7 @@ function selectTimeLabel(data) {
766887 {{ content }}
767888 </text>
768889 </g>
769- </template >
890+ </template> -->
770891
771892 <template #plot-comment =" { plot } " >
772893 <div :style =" `font-size: 12px; color:${plot.color}; text-align:center`" >
@@ -801,7 +922,7 @@ function selectTimeLabel(data) {
801922 <circle :cx="svg.width / 2" :cy="svg.height / 2" :r="30" fill="#42d392" />
802923 <text :x="svg.width / 2" :y="svg.height / 2" text-anchor="middle">#SVG</text>
803924 </template> -->
804- <template #time-label =" { x , y , fontSize , fill , transform , absoluteIndex , content , textAnchor } " >
925+ <!-- < template #time-label="{ x, y, fontSize, fill, transform, absoluteIndex, content, textAnchor }">
805926 <g @click="() => selectTimeLabel({ x, y, fontSize, absoluteIndex })">
806927 <text :x="x" :y="y" :font-size="fontSize" :text-anchor="textAnchor" :fill="fill">
807928 {{ content }}
@@ -811,7 +932,7 @@ function selectTimeLabel(data) {
811932 {{ content }}
812933 </text>
813934 </g>
814- </template >
935+ </template> -->
815936 <template #optionPdf >
816937 PRINT PDF
817938 </template >
0 commit comments