All the labels on X-axis are not getting plotted.

swapnilpingale
edited February 11, 2022 in Analytics #1
<div>Hi All,</div>
<div>I am new to BIRT reports and currently working on Line charts.</div>
<div>I am able to generate a line chart but facing one issue.</div>
<div>Issue: All the values on X-axis are not getting plotted properly.</div>
<div>I am generating a series through which x-axis gets populated but somehow it does not show all the values.</div>
<div> </div>
<div>For example,<em><strong> My X-axis should be "TELL-D1","TELL-D2","TELL-P1","TELL-P2","TELL-P3","TELL-P4","TELL-P5","TELL-P6","TELL-P7","TELL-P8"</strong></em></div>
<div> </div>
<div><em><strong>but i can see only "TELL-D1","TELL-P1","TELL-P3","TELL-P5","TELL-P8" that means only even type of values are displayed or we can say alternate values are being displayed.</strong></em></div>
<div>I have not done any setting in design due to which this can happen but am not aware how and why it is happening.</div>
<div>The Label object for x-axis is having only 5 values when i checked the label object in beforeGeneratingAxisLabel script hence it plots only 5 values.</div>
<div>This is strange behaviour since when i checked the dataset values for x-axis in onFetch i got all the values but somehow those are not present while plotting labels.</div>
<div>Please find attachments for detail design of my report.</div>
<div>Please observe the X-axis on both the attachments.</div>
<div> </div>

Comments

  • <p>Can you provide some sample data and a rptdesign for us to look at?  At first glance it appears that this is happening because the labels are overlapping, I think you're seeing this behavior to help with readability.  If you can't attach sample data can you recreate the issue with the classic models database provided and attach the rptdesign?</p>
    <p> </p>
    <p>Thanks!</p>
    Warning No formatter is installed for the format ipb
  • swapnilpingale
    edited September 24, 2015 #3
    <p>Hi Kristopher,</p>
    <p>Thanks for the response.</p>
    <p>Its not the problem of overlapping i have verified this by putting single character for labels.</p>
    <p>As i mentioned previously, i checked the valued of lable object in beforeDrawSeriesLabel() where i was able to see only few valued and only those values got plotted as label on x-axis.</p>
    <p>i am taking the x-axis from db.</p>
    <p>One more behavior that i came across is i just set all the series visible to false in design and run the report at that time all the value got plotted properly on x-axis but since the series was hidden chart was blank.</p>
    <p>Attaching the rptdesign.</p>
  • <p>I think it has to do with the settings on the x-axis label interval. select auto or 1 if you have 2 selected.</p>
  • <p>Hi Shamo,</p>
    <p>Thanks for the suggestion.But let me tell you everything is proper, i mean to say scale interval as well as label interval is set to 1 only.</p>
  • <p>can you replicate report with classic model since your report can't be ran?</p>
  • <p>Hey Shamo,</p>
    <p>Thanks.</p>
    <p>I got my problem.It was the width of chart.i increased the width and label got plotted as required.</p>
    <p>Such silly mistake i made which was not easily identifiable. </p>
    <p>Thanks all of you.</p>
  • PaulCooper
    edited September 29, 2015 #8
    <p>Swapnilpingale,</p>
    <p> </p>
    <p>The side-effect occurs because the size of the text in respect of the space available. The fact it hides half of them to create more room works for continuous axes such as date but is no good for category based axes. You have solved this by widening the chart to create the space. Other solutions are to rotate the text or to reduce the size of font of the text.</p>
    <p> </p>
    <p>If the chart has a variable number of labels/categories then these type of fixes are not proper solutions. The only way to fix it properly is to use code to dynamically alter the font size before the chart is rendered based on the data and maybe the longest label length. I have done this before but found that size required is not alway what is expected, which would be inversely propertional to the gap between the labels and also dependent on the angle and longest length of label. As the chart can adjust its size too this would be a tricky nut to crack particularly without knowing how the chart code works. Consequently in these situations it makes sense to experiment and find what works best.</p>
    <p> </p>
    <p>Paul</p>
  • <p>Hi Paul,</p>
    <p>Thanks for your valuable input.</p>
    <p>As you suggested about rotating the text also solves the problem.</p>
    <p>Thanks a lot.</p>