Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
Date Chart - Dynamically change minor grid count based on major grid
Migrateduser
Hello,
I have the following problem: I have reports with line charts which are deployed in a Servlet. The user can filter the data so sometimes the chart displays data of 1 week, sometimes data of several months.
In general I do like how BIRT dynamically creates the major grid tick count but on the other hand this is also my problem:
The customer I'm working for wants minor grid ticks for every day when the major grid represents weeks (and minor ticks for weeks if major grid = month etc). So I can set minor grid count to 7, which yields the correct result for this case. But when more/less data is displayed the minor ticks are still 7 and I get a tick for every second day, or if less data is shown, it shows a tick for every seventh of a day. And so on. I think you get the point.
I did some research but can't really figure out how to adjust the minor grid count programmatically. The approach would be to fill the chart with data, check the spacing of the major grid (e.g. 1 week or 2 days or 1 day etc.), and then set the minor grid count to a respective value.
But I can't figure out which chart objects / methods I have to use for that.
Any help is appreciated!
Kind regards and thanks in advance, Jakob
PS: A small not really related question (let me know if I should open a new topic for it):
The values are determined by a count() function in the chart's 'Select Data' tab. If there is no data for one particular day, the chart doesn't display it. Is it possible to have a count of zero instead, so the chart would also display the zero values?
First picture: Minor Grid count inappropriate because major grid = 2 weeks
Second picture: Minor Grid count appropriate because major grid = 1 week
Find more posts tagged with
Comments
There are no comments yet