【问题标题】:How can I stop the category axis overlapping my kendo chart?如何停止类别轴与我的剑道图表重叠?
【发布时间】:2016-08-05 11:37:06
【问题描述】:

请您告诉我如何停止类别轴重叠?它在 Chrome 中存在此问题,但在 Internet Explorer 中没有。有时当我在 Chrome 中刷新时,它会按预期工作 - 它不会重叠。

我尝试将axiscrossingvalue设置为各种值,但没有帮助。

这是我的代码:

@(Html.Kendo().Chart()
.Name("sales_count")
.Title("Sales Count: " + Model.SalesCount_Total[0])
.Legend(legend => legend
    .Visible(false)
)
.ChartArea(chartArea => chartArea
    .Background("transparent")
    .Height(graphHeight)
)
.Series(series =>
{
    series
    .Column(Model.SalesCount_Values[0]).Name("Total Sales")
    .Color(Model.Colors[2]).Opacity(1);
})
.CategoryAxis(axis => axis
    .Categories(Model.SalesCount_Categories[0])
    .MajorGridLines(lines => lines.Visible(false))
    .Labels(label => label.Rotation(270))
)
.ValueAxis(axis => axis
                .Numeric("Value")
                .Min(0)
)
.Tooltip(tooltip => tooltip
    .Visible(true)
     .Template("#= category #: #= value#"))
)

【问题讨论】:

  • 你能试试 .Rotation(-90)。它对我来说很好。
  • 我尝试了 -90 度旋转并遇到了同样的问题。有时我刷新它看起来不错,有时却不行。

标签: kendo-ui kendo-asp.net-mvc telerik-mvc


【解决方案1】:

我发现给标签一个边距可以阻止它与图表数据重叠。

    .Labels(label => label.Rotation(270).Margin(15))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-24
    • 1970-01-01
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多