【问题标题】:How to increase the distance between the columns in the legend Core plot pieChart如何增加图例中的列之间的距离 Core plot pie Chart
【发布时间】:2014-04-15 11:54:11
【问题描述】:

我希望图表下方有 2 列图例,并且我希望它们位于屏幕的两侧,而不是左侧。 这是它现在的样子:

我该怎么做?

【问题讨论】:

    标签: ios objective-c core-plot pie-chart


    【解决方案1】:

    Core Plot 图例有许多选项可用于自定义布局,包括色样的大小、行和列之间的间距以及网格中的行数和/或列数。详情请见the CPTLegend docs

    图例本身只是一个CPTLayer(核心动画CALayer 子类)。 Core Plot 图为定位图例提供了便利的属性(legendAnchorlegendDisplacement)。如果这些不能提供足够的控制,您可以使用注释将图例图层放置在您想要的任何位置。使用图层注释将位置与特定的图形图层(固定屏幕位置)或绘图空间注释相关联,使其与绘图数据一起移动。

    【讨论】:

      【解决方案2】:

      只需一行代码即可完成:theLegend.columnMargin = 90.0;theLegend.columnWidths = arrOfWidths;

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-07-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-05-29
        • 2017-12-02
        • 2021-01-04
        相关资源
        最近更新 更多