on 12-18-2007 1:44 PM
Hi all,
I need help in BAR chart as my confusion is i am creating a BAR chart for material and its one of property suppose i have 5 material and porperty value,
than i want to use some condition on value and assign color to each bar representing different material value . itz possible to assign dynamically values to BAR chart .
Thanks in Advance
Regards,
Praveen
Praveen
Try this code it may help you . i have 3 colors which are pre defined in display template (pen's 30,31,32).i trying to set colors for bars based on the value
var rows=document.flowGrid.getGridObject().getRowCount();
for(r=1;r<=rows;r++)
{
a[r]=document.Chart.getChartObject().getYDataValueAt(r,1);
if(a[r]<95)
{
if(a[r]<=84)
{
b[r]=32;
PColor1[r]=document.Chart.getChartObject().getPenColor(b[r]);
}
if(a[r]>=85)
{
b[r]=30;
PColor1[r]=document.Chart.getChartObject().getPenColor(b[r]);
}
}
else
{
b[r]=31;
PColor1[r]=document.Chart.getChartObject().getPenColor(b[r]);
}
}
for(m=1;m<=rows;m++)
{
document.Chart.getChartObject().setPenColor(m,PColor1[m]);
}
document.stageWiseChart.refresh();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
I've been playing around with your scenario. If you are using the Chart Action in the Logic Editor, I found that you could change the color of one of the bars, based on a value, like this:
- Use a Query action to load your Query Template
- Add a Chart Action, but leave the Query Template blank in the Configuration screen. Use the Link Editor for that action instead to link the name of the Query Template from the Query Action block above. Choose the ChartType parameter as "Bar".
- In the Link Editor for the Chart Action, use the the stringif function to change the PenColor based on a value. For example, this links to PenColor.1 in the Chart Action:
stringif(IllumTagQuery_0.Results/Rowsets/Rowset/Row/AssetUtil1} > 95, "#0000FF", "#0EECC0") to IllumChart_0.PenColor.1
I don't know if this is what you are looking for, but I thought it worth considering.
Kind Regards,
Diana Hoppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Praveen,
Take a look at the help docs about setting pen colors.
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.