简体   繁体   English

剑道图表:记录Y轴主要刻度标签

[英]Kendo Chart: Log Y-Axis Major Tick label issue

I am using Kendo Chart for plotting data points using Scatter Line chart with dual Y - Axis & both X/Y axis of type "LOG" scale. 我正在使用Kendo图表,使用散点图绘制的数据点具有双Y-轴和X / Y轴均为“ LOG”比例类型。

Everything were working fine in all browsers until today, I noticed in Chrome browser ONLY - Y axis scale starts with 0.000009999999999999 (instead of 0.00001). 直到今天,所有浏览器都运行良好,直到今天,我才注意到只有Chrome浏览器-Y轴刻度以0.000009999999999999(而不是0.00001)开头。 please find attached screenshot. 请找到随附的屏幕截图。

在此处输入图片说明

This rendering issue is not happening for other Y-axis. 对于其他Y轴,不会发生此渲染问题。 Before rendering I am setting axes MIN/MAX/AXISCROSSINGVALUE for each axes. 渲染之前,我为每个轴设置了MIN / MAX / AXISCROSSINGVALUE轴。

Also, please suggest alternative method for formatting Y-Axis tick label. 另外,请提出另一种格式化Y轴刻度标签的方法。

You can use a function for plotting the scale. 您可以使用一个函数来绘制比例尺。 Add the function to you axis data. 将功能添加到轴数据。

yAxis: {
            name: " name",
            title: {
                text: "bla",
                font: "10px Open Sans",
                color: "#4D4D4D"
            },
            labels: {
                format: "{0:N0}"
            },
            min: 10,
            max: 10000,
            type: "log",
            data: mySequence()
        },

Then you function can be a simple loop (this is just a example i´ve made) 然后,您的功能可以是一个简单的循环(这只是我所做的一个示例)

 function mySequence() {
        var arr = [];
        var n = 1;
        while (n < 10000) {
            n = n * 10;
            arr.push(n);
        }            
        return arr;
    }

mind the type: "log" definition since it´sa logarithmic scale 注意类型:“ log”定义,因为它是对数刻度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM