Charty icon indicating copy to clipboard operation
Charty copied to clipboard

Mix of positive and negative values in HorizontalBarChart?

Open parrotcar00 opened this issue 3 years ago • 4 comments

Does charty support a mix of positive and negative integer values in a HorizontalBarChart? I tried a simple horizontal bar chart with a mix of positive and negative y-axis values and the negative values were clipped in the resulting chart. Before I try any further, wanted to confirm if this is indeed a supported usecase?

parrotcar00 avatar Oct 15 '22 17:10 parrotcar00

Hey, For real, I have not tested with that values. Mind testing and let me know please?

hi-manshu avatar Oct 15 '22 21:10 hi-manshu

This is what it looks like: Horizontal bar chart

And this is the dataset I used to generate the above:

    val horizontalBarData = listOf(
        HorizontalBarData(10F, "A"),
        HorizontalBarData(20F, "B"),
        HorizontalBarData(75F, "C"),
        HorizontalBarData(-40F, "D"),
        HorizontalBarData(10F, "E"),
        HorizontalBarData(20F, "F"),
    )

As you can see the bar labeled D is negative and it is clipped. For negative values, I was expecting an output something like this: Horizontal bar chart

parrotcar00 avatar Oct 15 '22 23:10 parrotcar00

This won't work. Will work on it

hi-manshu avatar Oct 15 '22 23:10 hi-manshu

This would be very useful for the CombinedBarChart as well which doesn't handle negative values properly.

ber4444 avatar Nov 21 '22 20:11 ber4444