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

Display chart in logarithmic way

1 Answer 62 Views
Chart
This is a migrated thread and some comments may be shown as answers.
stephane
Top achievements
Rank 1
stephane asked on 12 Jun 2014, 05:02 PM
I would like to display following chart in logarithmic way 

@(Html.Kendo().Chart()
    .Name("chart3")
    .Title("Time Based graph")
         .SeriesDefaults(seriesDefaults => seriesDefaults.Line().Style(ChartLineStyle.Smooth).Markers(false)
          )
           .Series(series =>
           {
               series
                   .Line(new double[] {102, 100, 98, 103, 105, 99, 98, 104, 102, 104, 100, 94, 104, 109, 142, 198, 512, 405, 709, 805, 1203, 845, 1000, 1025, 1002, 1120, 1205, 1508});
           }
           )
           .CategoryAxis(axis => axis
              .Categories(new DateTime[]
              {
                  new DateTime(2011,01,01), new DateTime(2011,01,02), new DateTime(2011,01,03), new DateTime(2011,01,04), new DateTime(2011,01,05), new DateTime(2011,01,06),
                  new DateTime(2011,01,07), new DateTime(2011,01,08), new DateTime(2011,01,09), new DateTime(2011,01,10), new DateTime(2011,01,11),
                  new DateTime(2011,01,12),
                  new DateTime(2011,01,13), new DateTime(2011,01,14), new DateTime(2011,01,15), new DateTime(2011,01,16), new DateTime(2011,01,17), new DateTime(2011,01,18),
                  new DateTime(2011,01,19), new DateTime(2011,01,20), new DateTime(2011,01,21), new DateTime(2011,01,22), new DateTime(2011,01,23),
                  new DateTime(2011,01,24), new DateTime(2011,01,25), new DateTime(2011,01,26), new DateTime(2011,01,27), new DateTime(2011,01,28)
              }
           )
           )
           
           )
I tries to add that option in VAlueAxis Proporties like that but it changed nothing 

@(Html.Kendo().Chart()
    .Name("chart3")
    .Title("Time Based graph")
         .SeriesDefaults(seriesDefaults => seriesDefaults.Line().Style(ChartLineStyle.Smooth).Markers(false)
          )
           .Series(series =>
           {
               series
                   .Line(new double[] { 102, 100, 98, 103, 105, 99, 98, 104, 102, 104, 100, 94, 104, 109, 142, 198, 512, 405, 709, 805, 1203, 845, 1000, 1025, 1002, 1120, 1205, 1508 });
           }
           )
           .CategoryAxis(axis => axis
              .Categories(new DateTime[]
              {
                  new DateTime(2011,01,01), new DateTime(2011,01,02), new DateTime(2011,01,03), new DateTime(2011,01,04), new DateTime(2011,01,05), new DateTime(2011,01,06),
                  new DateTime(2011,01,07), new DateTime(2011,01,08), new DateTime(2011,01,09), new DateTime(2011,01,10), new DateTime(2011,01,11),
                  new DateTime(2011,01,12),
                  new DateTime(2011,01,13), new DateTime(2011,01,14), new DateTime(2011,01,15), new DateTime(2011,01,16), new DateTime(2011,01,17), new DateTime(2011,01,18),
                  new DateTime(2011,01,19), new DateTime(2011,01,20), new DateTime(2011,01,21), new DateTime(2011,01,22), new DateTime(2011,01,23),
                  new DateTime(2011,01,24), new DateTime(2011,01,25), new DateTime(2011,01,26), new DateTime(2011,01,27), new DateTime(2011,01,28)
              }
           )
           )
           .ValueAxis(a => a.Logarithmic())
)


Could you help me please?

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 16 Jun 2014, 06:42 AM
Hello,

The sample code you provided appears to be working in my tests.
Perhaps adding the value axis minor grid lines will help indicate that the axis is logarithmic:
.ValueAxis(a => a.
  Logarithmic()
  .MinorGridLines(minorGridLines => minorGridLines.Visible(true))
  .Max(10000)
)


See attachment for reference.
I hope this helps.

Regards,
T. Tsonev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
stephane
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or