How can I show only the last point of a Flot chart

怎甘沉沦 提交于 2019-12-11 18:51:44

问题


I have made a Flot chart that uses the settings below and the graph depicted is a line with 4 points (every time). I want only the last dot (point) to be shown. Have you got any idea how can I do it? (Or probably can you tell me a way in order to put a step in my graph and show only dot after 3 points?)

var chart_plot_01_settings = {
          series: {

            lines: {
              show: false,
              fill: 1,  
            },

            splines: {
              show: true,
              tension: 0.4,
              lineWidth: 2,
              fill: 0.1,
            },

            points: {
              radius: 8,
              lineWidth: 1,
              show: false,
              symbol: "circle",
              fillColor: SentimentCircle
            },

            shadowSize: 1

          },
          grid: {
            verticalLines: true,
            hoverable: true,
            clickable: true,
            tickColor: "#000",
            borderWidth: 1,
            color: '#fff'
          },
          colors: ['#888'],

          xaxis: {
            tickColor: "#fff",
            mode: "time",
            tickSize: [1, "month"],
            axisLabel: "month",
            axisLabelUseCanvas: true,
            axisLabelFontSizePixels: 12,
            axisLabelFontFamily: 'Verdana, Arial',
            axisLabelPadding: 10
          },
          yaxis: {
            show: false,
            ticks: 8,
            tickColor: "#fff",
          },
           tooltip: false,
        }

回答1:


That is not possible with the normal options. What you can do is copy only the last data point to a second data series and for that data series use points: { show: true } in the options to show the point.



来源:https://stackoverflow.com/questions/47572394/how-can-i-show-only-the-last-point-of-a-flot-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!