hi-manshu/Charty

Mix of positive and negative values in HorizontalBarChart?

parrotcar00 opened this issue · 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?

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

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

This won't work. Will work on it

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