This is a migrated thread and some comments may be shown as answers.

Chart ValueAxis positioning

1 Answer 492 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Marty
Top achievements
Rank 1
Marty asked on 21 Dec 2012, 06:31 PM
Hi, wondering if there is a way to position the valueaxis labels to the right side of the chart.  I know you can mirror the labels, but I was wondering if we can position them on right side.  I can only find an API for mirror.
thanks
Marty

    @(Html.Kendo().Chart()
        .Name("chart")
        .Title("Trend (30 Days)")
        .HtmlAttributes(new { style = "height:240px;" })
        .SeriesDefaults(seriesDefaults =>
            seriesDefaults
            .Line()
            .Stack(true)
            .Width(1)
            .MissingValues(ChartLineMissingValues.Interpolate)
            .Markers(false))
        .ValueAxis(v=>v.Numeric().Labels(l=>l.Mirror(true)))

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Dec 2012, 07:22 AM
Hi Marty,

 Right alignment is achieved by using the axis crossing value setting. Here is a live demo: http://jsbin.com/iyiqec/1/edit

 Here is the equivalent razor code:

@(Html.Kendo().Chart(Model)
    .Name("chart")
    .Title("Internet Users")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .Series(series => {
        series.Line(model => model.Value)
            .Name("United States")
            .Labels(labels => labels.Format("{0}%").Visible(true));
    })
    .CategoryAxis(axis => axis
      .AxisCrossingValue(5)
        .Categories(model => model.Year)
    )
    .ValueAxis(axis => axis.Numeric()
        .Labels(labels => labels.Format("{0}%"))
    )
)

Greetings,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Marty
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or