1

I have made a jqplot which has one line which is dynamical created from some question and 2 others, an industry standard and a best practices line.

I want to be able to change the color of the dynamical created line when it goes below the industry standard and change it again if it goes above the best practices line.

Is this possible or am I trying to take this too far?

Thank you all in advance for your response.

here is some of my code:

//Get radio Values  var values = $('input:radio:checked').map(function () { 
  return this.value; }).get(); 


    var line1 =[[1,values[0]], [2,values[1]], [3,values[2]], [4,values[3]], [5,values[4]]];
var line2 =[[1,4],[2,5],[3,4],[4,5],[5,5]];
var line3 =[[1,1],[2,2],[3,2],[4,4],[5,4]];

  $.jqplot('chartdiv',  [line2,line1,line3],

{  title:'Best Practices Chart',   highlighter: {useAxesFormatters: true,       showTooltip: true,
tooltipLocation: 'nw',
lineWidthAdjust: 2.5, },

grid:{  
drawGridLines: true,
backgroundColor: '#FFFFFF'},//plot labels   axes:{yaxis:{ticks:['Poor','Low', 'Medium', 'High', 'Best Practice'],   renderer: $.jqplot.CategoryAxisRenderer,


xaxis:{ticks:['DP Officer', 'Policies & Procedures', 'Awareness & Education', 'Information Security', 'Data Quality'],   renderer: $.jqplot.CategoryAxisRenderer, 

seriesColors: ["#00FF00", "#000000", "#0000FF"],legend: {
        show: true,
      }, series: [

{markerOptions: {style:'dimaond'}, label: 'Best Practise'},
{label: 'Your Practise'},
{markerOptions: {style:'filledSquare'}, label: 'Average Practise'},],
    });
  }); });
4

1 回答 1

0

该示例展示了一个系列的动态重绘。 在 2 秒后的示例中,第一个白色的线被重新绘制为黑色。您可以使用它进行重绘,但请记住,它不会更改其默认属性,例如,当您按下按钮时,线条会以默认颜色重绘,例如在示例中。

于 2012-06-22T12:32:28.093 回答