简体   繁体   English

有没有办法添加两个文本值,一个在条形图上方,一个在条形图下方? 在 ios danielgindi 图表中

[英]Is there a way to add two text values one above and one below bar chart? In ios danielgindi charts

enter image description here在此处输入图片说明

is there a way to add two text values one above and one below bar chart as shown in the image有没有办法添加两个文本值,一个在条形图上方,一个在条形图下方,如图所示

Thanks in advance提前致谢

You can combine two (and more) different values using \\n symbol as delimiter on data preparing step.您可以在数据准备步骤中使用\\n符号作为分隔符组合两个(或更多)不同的值。 Or use IAxisValueFormatter for more control.或者使用IAxisValueFormatter进行更多控制。 Something like this for example:例如这样的事情:

extension ChartController: IAxisValueFormatter {

    func stringForValue(_ value: Double, axis: AxisBase?) -> String {
        if axis is XAxis {
            return "Sting 1\nString2"
        } 
    }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM