Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

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

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,
        }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...