How to set axis line at bottom when all data 0 in jfreechart's bar chart? - jfreechart

I use Jfreechart's bar chart to show data. But in case all data is 0, the axis line will be displayed in middle of chart. I just want to display the axis line in bottom as usual cases.
How can I configure it? Thanks!

Assuming a DefaultCategoryDataset for example, use the clear() method when all values are sufficiently close to zero that you want to display no data. Alternatively, use setRangeWithMargins() when a specific range would be more meaningful.

Related

Lightview chart histogram like Highcharts Stacked bar

Is there any way I can make a Lightview histogram chart with multiple values per data point, so that it looks like a Highchart stacked bar (https://www.highcharts.com/demo/bar-stacked)?
If not, is there a workaround?
I already overlay-ed two separate histograms, but that does not help, because both start at the bottom and depending on the values some points are hidden.
Unfortunately it's not possible to draw vertical histogram at the moment.

How to hide axis bars in area chart and line chart in Google Data Studio

I currently have this issue where I am trying to hide the Y-axis of this line chart. Currently there is only the option to hide both axes in GDS.
Issue being is that the floating number at the y axis looks awkward.
Could anyone think of a work around? maybe hiding both axes and then creating a blank chart with the date values and using that as the x axis ticks.
One workaround is to draw a Shape or line over the axis and set it to a colour that blends in with the background, (although in the case above, it would cut into the first data point and data label) using Shift + movement keys for precision placement.
Google Data Studio Report as well as a GIF to elaborate:

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

SSRS Chart series title not show all text

I make Chart Report using SSRS
I have problem is my long series label not show whole text For Example
if label is "Personal Computer" it's show "Personal C......"
see image below
and this is whole Chart area
it's have more space between legend and series label I want to use this space to show whole text like this
How to fix this problem ?
Thank you.
Kindly Add the Legend on Right side of the Bar chart and Check
You need to fix the Chart Area height so that it is approximately half the height of the chart. This then allows sufficient space for the x axis labels.
You also nee to set the minimum and maximum font sizes for the x-axis.
I suggest between 6 and 8 pt.
Try setting the label rotation to 90 degrees instead of 45 also make sure the x axis interval is set to 1 and not auto.
[ Also have a look at this article ]
(http://www.douglane.net/fit-chart-labels-in-ssrs/)

JFreeChart BarChart setUpperMargin to next interval?

I am using JFreeChart to create a BarChart. My question: is there a way to set the uppermargin of the graph to stop at the next interval? As an example, say a Bar Graph is made with range intervals of 5. Say the tallest bar ends at 30. Is there a way automatically set margins to make the graph go vertically until 35-the next interval? I know there is a setUpperMargin method but that requires inputting double values until one achieves the upper range he wants. Instead, is there a way to just set the margin to go for another interval after the end of the bar graphs? Thank you.
Query your chosen CategoryDataset for the maximal range value and use setUpperBound() on the range axis. BarChartDemo1, included in the distribution, shows how to reference an axis.

Resources