You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/12/23 11:38:59 UTC

[GitHub] [echarts] willonf commented on issue #16262: [Feature] Is it possible to put marks ona a gauge echart? Like the black marks on image below

willonf commented on issue #16262:
URL: https://github.com/apache/echarts/issues/16262#issuecomment-1000245299


   Here what I did if someone needs too:
   
   ```
   gaugeChartTemperatureOptions: EChartsOption = {
           series: [
               {
                   type: "gauge",
                   center: ["50%", "60%"],
                   startAngle: 200,
                   endAngle: -20,
                   min: 0,
                   max: 100,
                   splitNumber: 10,
                   itemStyle: {
                       color: "#4caf50"
                   },
                   progress: {
                       show: true,
                       width: 30
                   },
   
                   pointer: {
                       show: false
                   },
                   axisLine: {
                       lineStyle: {
                           width: 30
                       }
                   },
                   axisTick: {
                       distance: -45,
                       splitNumber: 5,
                       lineStyle: {
                           width: 2,
                           color: "#999"
                       }
                   },
                   splitLine: {
                       distance: -52,
                       length: 14,
                       lineStyle: {
                           width: 3,
                           color: "#999"
                       }
                   },
                   axisLabel: {
                       distance: -20,
                       color: "#999",
                       fontSize: 20
                   },
                   anchor: {
                       show: false
                   },
                   title: {
                       show: true,
                   },
                   detail: {
                       valueAnimation: true,
                       width: "60%",
                       lineHeight: 40,
                       borderRadius: 8,
                       offsetCenter: [0, "-15%"],
                       fontSize: 40,
                       fontWeight: "bolder",
                       formatter: "{value} °C",
                       color: "inherit"
                   },
                   data: [{value: 0}],
                   animationEasingUpdate: "cubicIn",
               },
   
               // Above echart
               {
                   type: "gauge",
                   center: ["50%", "60%"],
                   z: 3,
   
                   endAngle: 79,  // Here you can dinamically change the value
                   max: 55,
   
   
                  startAngle: 168.1, // Here you can dinamically change the value
                   min: 14.5,
                   splitNumber: 1,
                   axisTick: {
                       show: false
                   },
                   axisLine: {
                       lineStyle: {
                           width: 0,
                       }
                   },
                   splitLine: {
                       distance: 0,
                       length: 30,
                       lineStyle: {
                           width: 2,
                           color: "black"
                       }
                   }
               },
           ]
       };
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org