-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stacked Horizontal Chart Scaling #2174
Comments
ah.. it's a little too much to digest. We support horizontal stacked bar chart natively already.. What's your purpose for the rotation? |
I'm only rotating it because I thought thats how I would get a horizontal chart :) But sounds like I am I setting this up incorrectly? Would you be able to point me to some examples that use a horizontal stacked chart? |
Ahh actually, think I just found some resources, looks like I use this? HorizontalBarChart |
Just check out ChartsDemo, there are plenty of examples :) stacked bars are just a special case, so horizontal and vertical both support this. |
Hey @liuxuan30 Im still getting some weird graphing after using the HorizontalBarChart and following examples: The following is the code I am using (where self is a HorizontalBarChartView): `
` As you can see both the X scal is incorrect (it should be from 0-10 not in multiples of 10) and the coloured bars don't look like they are behaving in a linear way. Any ideas where else I should be looking? Or if you needed more specific info maybe? Thanks @liuxuan30 |
Actually I've just realised I've been using it incorrectly! Those array values should be the values of the size of the sections in the stack. I've incorrectly assumed that they are the start and end points of each of the stack sections |
:) so problem solved? If so, please close this or I will close it |
Oh yep, this is solved (or wasn't even a problem at all ;) Thanks for your help |
Hi there,
I am trying to draw a single horizontal stacked bar chart (its basically a regular stacked bar chart with a frameCenterRotation = -90 to make it horizontal) with linear data points. The yVal array I'm passing for x = 0 is:
[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
So I am expecting the stacked bar chart to have equal length bars if the scale was linear. But when I draw them, it looks like this:
The following is the code I am using (self is a BarChartView):
`
//set data
let dataSet = BarChartDataSet(values: dataPoints, label: "Timeline")
dataSet.colors =[Theme.timeTrackingHorizontalTimeslotColour,Theme.timeTrackingHorizontalGapColour]
dataSet.valueFont = Theme.getChartFont()
dataSet.valueTextColor = Theme.appDefaultTextColour
dataSet.drawValuesEnabled = false
Is there anything here where I can get the bar sections to be equidistant / work on a linear scale?
Thanks
The text was updated successfully, but these errors were encountered: