Issue #17 resolved

options not working for plugins ?

Anonymous created an issue

Hi everyone,

I can't get the options system working for the plugins, look at this piece of code :

{{{

!javascript

myplot = $.jqplot('myplotdiv',[s1],{
    title: 'mytitle',
    axes: {
        xaxis: {
            renderer: $.jqplot.DateAxisRenderer, //working
            tickOptions: {
                formatString: '%H:%S' //working
            },
            numberTicks: 12 //working
        },
        yaxis: {
            tickOptions: {
                formatString: '%.2f' //working
            }
        }
    },
    dragable: {
    color: '#cccccc', //NOT WORKING
        contstrainTo: 'x' //NOT WORKING
    },
    trendline: {
          color: '#cccccc' //NOT WORKING
    }

}); }}}

Am I doing something wrong ?

Moreover, when I go direct in the source file and when I "hard code" constraintTo : 'x' for the dragable plugin this is not working !

I am using last version,

Thanks for your help

Cyril

Comments (8)

  1. Anonymous

    There is a mistake in the previous message, you should read : constraintTo intead of contstraintTo

  2. Chris Leonello repo owner

    dragable and trendline are series specific options, so you need to specify them like so:

    series:[{
      dragable: {
      color: '#cccccc',
          constrainTo: 'x'
      },
      trendline: {
            color: '#cccccc'
      }
    }]
    

    You could optionally specify them in the seriesDefaults option to have them apply to all series. I'll update the docs with this.

    NOTE: You did uncover a typo in the code: "constrainTo" was mistyped in the code as "contstrainTo". I've fixed and attached a patched file. I'll update source repository later today.

  3. Anonymous

    Thank you !

    Your work is amazing, this is really the best chart lib I've ever seen in the jQuery world. Work a lot on the documentation, because to use it properly we have to read pieces of code from src... and you'll be famous ;)

    Cyril

  4. Anonymous

    I think there is an overwriting somewhere in the options parsing function

    I tried the code you shared few minutes ago, and when I put a different color in the draggable options and in the trendline option, the draggable take always the trendline color. I can put anything in the dragable options, this is always displayed as the trendline color.

    Best luck,

    Cyril

  5. Chris Leonello repo owner

    Fixed bug #17 again. Fixed dragable color issue when used with trend lines. Trend lines were being drawn on top of the drag line, which made drag line look to have the same color as the trend line. now dragable disables trend line drawing while dragging.

    Also fixed color of marker while dragging.

    2c06f3ae225f

  6. Log in to comment