标签: jqplot

基于相同日期或时间的多行jqplot图表

我有以下数据,我想用线条图上的jqplot用2行绘制它们.

series:[Time  Value1 Value2] 
      [13:51 22.875 9.275]
Run Code Online (Sandbox Code Playgroud)

我正在寻找的是与XAxis聊天 :时间L1:[Yaxis1:Value1] L2:[Yaxis2:Value2].

我可以公平地将数据结构更改为[时间值1]和[时间值2]或任何其他类型但重要的是将它们一起绘制在一个图表中.你能写一下代码的划痕还是请参考一个正确的例子?谢谢

linechart jqplot

0
推荐指数
1
解决办法
1万
查看次数

jq plot - 获得线性x轴刻度

我有一个jqPlot图表,如下图所示.

我使用LinearAxisRenderer作为x轴.

但x轴值为0,1,1,2,2等.

有没有办法让值为0,1,2,3等.

提前致谢.

在此输入图像描述

代码:

 $.jqplot(ctrlId, [graphPt], {
        title: chartTitle,
        seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            pointLabels: { show: true, location: 'e', edgeTolerance: -15, formatString: '%s' },
            shadow: false,
            rendererOptions: {
                barDirection: 'horizontal',
                barMargin: 2
            }
        },
        axesDefaults: {
            renderer: $.jqplot.canvasAxisTickRenderer,
            min: 0,      // minimum numerical value of the axis.  Determined automatically.
            pad: 1.3,       // a factor multiplied by the data range on the axis to give the
            // axis range so that data points don't fall on the edges of …
Run Code Online (Sandbox Code Playgroud)

jqgrid jqplot

0
推荐指数
1
解决办法
4328
查看次数

Jqplot - 荧光笔显示工具提示,其中包含来自多个y轴的数据

我正在使用JqPlot.

这是我的小提琴,下面是我的截图.我使用两个y轴.在左边的y轴上我有我的收入,在我的右边y轴上我有我的页面浏览量.

现在悬停在线上,我想在工具提示中显示视图和收入,如下例所示,我一次只能从2个轴获取数据.

有什么想法吗 ?

在此输入图像描述

以下是我的代码

$(document).ready(function () {

  $.jqplot.config.enablePlugins = true;

  s1 = [['23-May-08',1, 11],['24-May-08',4, 14],['25-May-08',2, 22],['26-May-08', 6, 26]];
  s2 = [['23-May-08',11, 1],['24-May-08',14, 4],['25-May-08',22, 2],['26-May-08', 26, 6]];

  plot1 = $.jqplot('chart',[s1, s2],{
     title: 'Highlighting, Dragging, Cursor and Trend Line',
     axes: {
         xaxis: {
             renderer: $.jqplot.DateAxisRenderer,
             tickOptions: {
                 formatString: '%#m/%#d/%y'
             },
             numberTicks: 4
         },
         yaxis: {
             tickOptions: {
                 formatString: '$%.2f'
             }
         }
     },
     highlighter: {
         show:true,
     },
     cursor: {
         show: true
     },
      series: [
        {
            lineWidth: 2,
            highlighter: { …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery graph jqplot

0
推荐指数
1
解决办法
1万
查看次数

在jqPlot中格式化Y轴编号

我设法将我的y轴文本格式化为两位小数,但由于我使用的是非常大的数字,有没有办法可以显示我的数字,如:

NAD 100,000,000.00
Run Code Online (Sandbox Code Playgroud)

而不是

NAD 100000000.00
Run Code Online (Sandbox Code Playgroud)

通过使用刻度选项

yaxis: { 
           tickOptions:{formatString:'NAD %.2f'} 
        } 
Run Code Online (Sandbox Code Playgroud)

javascript jquery jqplot

0
推荐指数
1
解决办法
3943
查看次数

JavaScript:用于"拆分"功能的正则表达式,用于排除逗号和换行符

我有以下结构的文本文件:

2013-12-31 15:42,1
2013-12-31 15:45,1
2013-12-31 15:45,0
2013-12-31 16:18,0
2013-12-31 16:18,1
2013-12-31 16:27,1
2013-12-31 16:27,0
2013-12-31 17:11,0
2013-12-31 17:11,1
2013-12-31 18:11,1
2013-12-31 18:11,0
Run Code Online (Sandbox Code Playgroud)

我通过get()导入它:

$.get('graph_data.txt', function(data){
...}
Run Code Online (Sandbox Code Playgroud)

这工作正常.后来我将这个数据解析为数组:

var array3 = data.split("\n");
Run Code Online (Sandbox Code Playgroud)

但我需要做的是用逗号或换行符拆分它.我知道split可以得到正则表达式,但我所做的所有尝试都没有成功:

.split("[,\\n]");
.split("/,|\s/");
.split("/,|\s/m");
Run Code Online (Sandbox Code Playgroud)

对我有用的是分两步完成 - 首先分成一个分隔符,然后分成第二个分隔符:

var array3 = data.split("\n")[0].split(",");
var array5 = data.split("\n")[1].split(",");
Run Code Online (Sandbox Code Playgroud)

但如果我在文件中有更多数据,那就太疯狂了.


为了实现我想要实现的目标,我需要更多的亮点:我需要获得用于绘制图表的coordainates数组.第一个值是日期,第二个值是0或1.

var line=[
    ['2013-12-31 15:42',1],
    ['2013-12-31 15:45',1],

    ['2013-12-31 15:45',0],
    ['2013-12-31 16:18',0],

    ['2013-12-31 16:18',1],
    ['2013-12-31 16:27',1],

    ['2013-12-31 16:27',0],
    ['2013-12-31 17:11',0],

    ['2013-12-31 17:11',1],
    ['2013-12-31 18:11',1],

    ['2013-12-31 18:11',0]
];
Run Code Online (Sandbox Code Playgroud)

我通过将每对中的第二个字符串映射到int来做到这一点:

var a1 = [array3[0], array5[0]]; …
Run Code Online (Sandbox Code Playgroud)

javascript regex jqplot

0
推荐指数
1
解决办法
350
查看次数

标签 统计

jqplot ×5

javascript ×3

jquery ×2

css ×1

graph ×1

jqgrid ×1

linechart ×1

regex ×1