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

2019-08-16 17:55发布

问题:

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.