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

template formatting and y-axis out of place

2 Answers 89 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 16 Dec 2015, 04:10 PM

Attached is an image showing my two issues, including the questions I have. For more detail, keep reading.

 

For the tooltip, here is the code I use to generate it.

.Tooltip(tt => tt.Visible(true).Template("#= value.x # - #= value.y #"))
                                .XField("Time")
                                .YField("Value");

The Time field is your standard C# DateTime. I combed through the documentation but I couldn't find a way to format that date tool tip to be a readable date and time rather than the Unix Time Stamp. Is there a way to do that?

For the top right chart, I'm just curious if there's a way to for the x-axis labels to always be displayed below the chart body? Here is the code used to generate the charts

@(Html.Kendo().Chart()
                            .Name(string.Format("server-side-chart-{0}-{1}", i + 1, ii + 1))
                            .Title(string.Format("Plot {0},{1}", i, ii))
                            .Series(s =>
                            {
                                s.ScatterLine(Model.DataGrid[i, ii].Data)
                                .Name("Data")
                                .Markers(false)
                                .VisibleInLegend(false)
                                .Tooltip(tt => tt.Visible(true).Template("#= value.x # - #= value.y #"))
                                .XField("Time")
                                .YField("Value");
                            })
                            .XAxis(x => x.Date().BaseUnit(ChartAxisBaseUnit.Seconds))
                    )

Thanks.

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 16 Dec 2015, 06:29 PM

Follow up question:

Are "Zoomable" and "Pannable" still supported with the Kendo.Chart? I see Documentation for it here (http://docs.telerik.com/kendo-ui/api/aspnet-mvc/Kendo.Mvc.UI.Fluent/ChartBuilder) but when I try to apply it to my chart I provided above I get compiler errors.

Thanks

0
Accepted
Iliana Dyankova
Telerik team
answered on 18 Dec 2015, 01:33 PM
Hi Chris,

Up to the questions
- ...The Time field is your standard C# DateTime....Is there a way to do that?
For this requirement you could use kendo.format or kendo.toString in the template:

//....
.Tooltip(tt => tt.Visible(true).Template("#= kendo.format('{0:dd/MM/yyyy}', value.x ) # - #= value.y #"))

- ...if there's a way to for the x-axis labels to always be displayed below the chart body?....
For this one you should specify yAxis.AxisCrossingValue. As an example: 
//....
.YAxis(y => y
   .Numeric()
   .AxisCrossingValue(-50000)
)

- Are "Zoomable" and "Pannable" still supported with the Kendo.Chart? 
This features were introduced in Kendo UI Q3 2015 release (v2015.3.1111) and will not work in previous versions. Could you please make sure you are using v2015.3.1111 (as pointed in the ticket info).

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