Tuesday, January 29, 2013 5:59 PM
I have a bar chart and I want the category labels (x-axis ) to be Chapters. So the Chapters should be labeled 1, 7, 89 ,60, depending on the data in the dataset, but the problem is that the chart software interprets the chapters as numbers and tries to scale the axes to that 0,1,2,3, etc are showing. I parse the chapters in a dataset as strings but the chart software still interprets them as numbers and applies scaling.
If I parse the chapters as -1-, -7-, -89- then they are correctly displayed. Is it possible to force the chart software to interpret these chapters as a strings and only display the Chapters in the data and not to try a apply scaling.
Tuesday, January 29, 2013 9:12 PMIn the horizontal axis properties, select axis type as Category, not Scalar (number/dates), then use your numbers as the category names.
Please mark as answered or vote helpful if this post help resolved your issue. Thanks!
k r o o t z
Tuesday, January 29, 2013 9:40 PM
Thank you for your reply. Unfortunately I do have it set to Category. The problem is if I have Chapters 11 and 20 in my dataset, the chart software still sees it as a number and scales the x-axis so it become 11, 12, 13, 14 etc. I just want to display 11 and 20. If I change 11 to "-11-" then it works, but unfortunately this is not what my client wants to see.
Tuesday, January 29, 2013 10:08 PM
You can try this.
- Right click on your dataset and choose "Add Calculated Field..."
- Add a field named "strChapters" with this expression as field source "=CStr(Fields!your_chapter_field.Value)"
- Use this new calculated field in your chart
Tuesday, January 29, 2013 10:37 PM
HI Edouarddp and Krootz.
I have got it working. I am not sure why it suddenly came right, but I deleted the chart and started again and now everything works well.
It could be that the dataset originally had Chapters as integer and then I changed the Chapters to string and refreshed the dataset. I am sure it did not pick up the changes.
Anyway once I started again from scratch and ensure the Category was selected and that the Chapters were strings it worked.
Thang you both for your input.
- Marked As Answer by STEERB Tuesday, January 29, 2013 10:37 PM