简体   繁体   English

高图在x和y轴上具有相同的刻度步长(相等的刻度间隔)

[英]Highcharts same scale steps (equal tick interval) on x and y axis

I'm trying to make fixed width and height for ticks but leave chart being resizable. 我正在尝试使刻度线的宽度和高度固定,但使图表可调整大小。

I've tried properties: 我已经尝试过属性:

tickInterval
tickPixelInterval

But these properties are not work together. 但是这些属性不能一起使用。 Is there any way to make "cells" square without making calculations and setting min/max? 有什么方法可以在不进行计算和设置最小/最大的情况下使“单元”成为正方形?

Data on chart are dinamically load. 图表上的数据是动态加载的。

图表

It is natural that the space between ticks is changing along with resizing chart but if you want to preserve the same pixel value between them, you need to perform calculation how many ticks to show, so the tickPixelInterval be the same. 刻度线之间的间距自然会随着调整图表的大小而变化,但是如果要在它们之间保留相同的像素值,则需要计算要显示的刻度线数,因此tickPixelInterval相同。 You can also add a scrollbar, to have access to hidden range but you require Highstock for that. 您还可以添加滚动条,以访问隐藏范围,但为此需要Highstock。 Take a look at the example posted below and in case of any question, feel free to ask. 请看下面发布的示例,如有任何疑问,请随时提问。

API Reference: API参考:
http://api.highcharts.com/highcharts/xAxis.tickPixelInterval http://api.highcharts.com/highcharts/xAxis.tickPixelInterval
http://api.highcharts.com/highcharts/Axis.setExtremes http://api.highcharts.com/highcharts/Axis.setExtremes
http://api.highcharts.com/highcharts/chart.events.redraw http://api.highcharts.com/highcharts/chart.events.redraw
http://api.highcharts.com/highstock/scrollbar http://api.highcharts.com/highstock/scrollbar

Example: 例:
http://jsfiddle.net/rq4fxt6j/ http://jsfiddle.net/rq4fxt6j/

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

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