Home
Analytics
Chart overlap values issue
rajkishore
<p>Hi,</p>
<p> </p>
<p>Chart is over lapping the values when the values are closer and hence i am unable to see the values what it is in IV. do we can avoid this? please suggest me.</p>
<p> </p>
<p>Attached is the sample report to reproduce the issue.</p>
<p> </p>
<p>Regards</p>
<p>Kishore G</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
JFreeman
<p>You can adjust the Y positioning of the series lables on a per series basis in the chart scripting.</p>
<p>For Example:</p>
<pre class="_prettyXprint _lang-js">
beforeDrawDataPoint: function(point, pointOptions, chart, seriesIndex, pointIndex)
{
if(point.series.name == "B"){
pointOptions.dataLabels = {
y: -25
}
}else if(point.series.name == "C"){
pointOptions.dataLabels = {
y: -50
}
}
},
</pre>
rajkishore
<p>Jfreeman Thanks for prompt reply, if have i more series than i need to hard code the values? if the value is changed instead of B or C to D or E in data base then i need modify the report again?</p>
<p> </p>
<p>if you could have any generalized solution that helps more.</p>
<p> </p>
<p>Thanks you.</p>
JFreeman
<p>Instead of using the series name you can use the seriesIndex.</p>
<p>For Example:</p>
<pre class="_prettyXprint _lang-js">
beforeDrawDataPoint: function(point, pointOptions, chart, seriesIndex, pointIndex)
{
if(seriesIndex == 1){
pointOptions.dataLabels = {
y: -25
}
}else if(seriesIndex == 2){
pointOptions.dataLabels = {
y: -50
}
}
},
</pre>
micajblock
<p>Personally I think this is bad practice. What you are doing is changing the values displayed in the chart, which is misleading. </p>
somnix
<p>is there a similar solution to move label on a BarChart ?</p>
JFreeman
<p>What format of chart are you using (HTML5, SVG, PNG, etc.)?</p>
<p> </p>
<p>In an HTML5 bar chart, the code should be quite similar to what I have already posted.</p>
somnix
<p>Hi Jesse,</p>
<p> </p>
<p>the format is SVG , but i m working on a report that i didn't created, so i don't know if it s the best choice .</p>
<p> </p>
<p>this reports are rendered in PDF , does it make any difference ?</p>
JFreeman
<p>The difference has to do with what scripting is required to make the change.</p>
<p>The SVG charts use different scripting than the HTML5 charts so the above code will not be applicable for your SVG chart.</p>
<p> </p>
<p>If you are on open source birt, the SVG chart is probably your best choice.</p>
<p>If you are on professional, I may recommend looking into changing it to an HTML5 chart.</p>
<p> </p>
<p>If you can provide a screenshot of the particular overlap issue you are facing with the SVG barchart, I can see about creating you a quick sample.</p>