-
-
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
HorizontalBarChartView text for xValues -- charts 3.0 #1646
Comments
In chart 3.0, x axis does not work any more as it used to be. The x axis is redesigned and works more like y axis. I tried with ChartsDemo horizontal bar chart with an trick What I know for the moment is, you can try change But do be aware that /// the number of label entries the y-axis should have
/// max = 25,
/// min = 2,
/// default = 6,
/// be aware that this number is not fixed and can only be approximated
open var labelCount: Int
{
get
{
return _labelCount
}
set
{
_labelCount = newValue
if _labelCount > 25
{
_labelCount = 25
}
if _labelCount < 2
{
_labelCount = 2
}
forceLabelsEnabled = false
}
}
open func setLabelCount(_ count: Int, force: Bool)
{
self.labelCount = count
forceLabelsEnabled = force
} Short answer is when enable @danielgindi Is there any other convenient way to configure this? I don't see there is property that controls |
I am lookind at what you mentiones @liuxuan30 , but I wanted to point the issue in another directions. My original chart looked like this: Is it possible to get that look, those company text labels on the new version? |
@caat91 To show those company text labels, you must use function |
@kientux your suggestion did the trick for me regarding the text labels, I just extended de IAxisValueFormatter protocol and added the stringForXValue methods. I was able to follow @liuxuan30 idea and got the following result but is there a way to align the labels with the bars? Also, Is this an issue than you are planning to address or is this just the new behaviour of the barchart and there are no plans of modifying it? |
well you have to debug a little, I don't see this in ChartsDemo. Need more info why not centered.. |
I meet the same issue using Charts 3.0 (in VerticalBarChartView as well), could you teach me how to write the extension in IAxisValueFormatter and added the 'stringForXValue' please? Thanks a lot |
Please see the demos. Another way is to just init a |
I am working with an horizontal bar chart, with version 2.2.5 my original code was:
But with the version 3.0 I can not create my BarChartData that way, so I do not know how to set the names I want as the xValues.
I am getting just 0/2/4... as the text, always even numbers every other bar and I have no idea how to get it fixed.
My current code:
var dataEntries: [BarChartDataEntry] = []
Current Result:
The text was updated successfully, but these errors were encountered: