Rotate any degree of X labels


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Arfan on 23rd May 2013
1. can i rotate x.label to any degree?

2. i write bar value inside bar chart like this and worked,

for (var i=0; i<obj.coords.length; ++i)
{
obj.context.fillStyle = 'black';
RGraph.Text(obj.context, 'Verdana', 8, obj.coords[i][0] + (obj.coords[i][2] / 2), obj.coords[i][1] + (obj.coords[i][3] / 12),obj.data_arr[i].toString(),'center','center', null,270,null,false);
}

how to use it with labels?

Posted by RGraph support on 23rd May 2013
Hi there,

1. Depending on the chart - with chart.text.angle
2. Yes - you can add your labels to an array and then set that array as the labels:

var labels = [];
for (var i=0; i<obj.coords.length; ++i)
{
     obj.context.fillStyle = 'black';
     RGraph.Text(obj.context, 'Verdana', 8, obj.coords[i][0] + (obj.coords[i][2] / 2), obj.coords[i][1] + (obj.coords[i][3] / 12),obj.data_arr[i].toString(),'center','center', null,270,null,false);

     labels.push(obj.data_arr[i].toString());
}

obj.Set('chart.labels', labels);



Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer

Add a reply

 




« Back to message list
RGraph on social media