Jump to content
Software FX Community

Increase bar width in bar graph


SAI

Recommended Posts

Hi,

I have 8 series bar graph generated using chartfx. I always use first or second 4 series to be plotted on graph with different colors. That was my requirement. The issue I am running into is all the bars shown on the graph are so thin. They are harder to see when I generate with large amount of data. I am using Chart.HIDDEN for the series which I do not want to show. How can I increase the width of the bars? I tried setVolume but seems to be not working properly. Is there any way I can opt to not to show hidden series on the graph?

Thanks in advance, 

 

 

Link to comment
Share on other sites

Hi,

The only way to manipulate the width of the bars is by using the setVolume nethod. Please ntoe however that the Volume refers to the percentage of the allocated area that each bar will use. In other words, when the chart is calculated, chartfx assigns a real estate for each bar  along the X axis. Let's say for example that the X axis has 300 pixels and that you have one series with 6 points. ChartFX will divide the available space (300ox) by the number of bars (6) which will result in 50px for each bar. Then, when you use the Volume property, you are basically telling the bar to use a percentage of those 50 pixels.

The maximum value you can pass to the setVolume method is 100%.

Now, if you want to hide a particular series all you need to do is set its visibility to false:

 chart1.getSeries(2).setVisible(false);

Hope this helps.

 Regards, 

TT

Link to comment
Share on other sites

Hi,

How are you passing data to the chart? What do you consider to be a Null series? Is it columns where all the values are null? Or is it a column with no records at all? I believe the best bet would actually be to identify those series before they are passed to the chart and either filter them or indetify them a null.

Regards,

 Tomas 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...