如何仅显示Flot图表的最后一点 [英] How can I show only the last point of a Flot chart

查看:98
本文介绍了如何仅显示Flot图表的最后一点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个Flot图表,该图表使用以下设置,并且所描绘的图形是一条带有4点(每次)的线.我只希望显示最后一个点(点).你知道我该怎么办吗? (或者也许您能告诉我一种方法,以便在图形中迈出一步,仅在3点后显示点?)

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,
        }

推荐答案

使用常规选项是不可能的.您可以做的是仅将最后一个数据点复制到第二个数据系列,并使用选项中的points: { show: true }来显示该点.

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.

这篇关于如何仅显示Flot图表的最后一点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆