如何在 highcharts/highstock中将滚动条位置设置为Left?

如图加载图表时,
滚动条自动向右对齐。
有没有办法将它定位到 Left?
我有一个 highstock 柱形图,它没有显示所有的值——我试图在这个例子中尽可能地简化它。我使用 highstock 因为我需要在列上有一个水平滚动条。
$('#container').highcharts({
tooltip: {
formatter: function () {
if (this.y === '' && this.y !== 0) {
return this.series.name + '<br/>' + this.x + ': NO DATA';
}
return this.series.name + '<br/>' + this.x + ': ' + this.y;
}
},
chart: {
type: 'column'
},
title: {
text: null
},
subtitle: {
text: null
},
xAxis: {
categories: labels,
title: {
text: null
},
labels: {
style: {
color: '#000',
}
},
lineWidth: 2,
lineColor: …Run Code Online (Sandbox Code Playgroud) 我在一个股票图表(HighCharts)中有多个具有不同规模的数据系列.
我想将每个系列连接到它的轴或显示每个系列的最后一个点的值(类似于数据标签,但仅适用于每个系列的最后一点)
$(function () {
$('#container').highcharts({
chart: {
renderTo: 'container'
},
xAxis: [{
type: 'datetime'
}],
yAxis: [{
opposite: true,
lineWidth: 1
},{
opposite: true,
lineWidth: 1
}],
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000, // one day
yAxis: 1
}, {
data: [20000, 2250, 30300, 28000, 27000, 27800, 25800],
pointStart: Date.UTC(2010, 0, 3),
pointInterval: 24 * 3600 * 1000, // one …Run Code Online (Sandbox Code Playgroud) 我想用 onclick 事件做轴十字准线。最初十字准线是启用的。单击切换工具提示按钮时,我们必须隐藏十字准线。
这是我的代码
<a href="#" id="toggle_tooltip"><i class="fa fa-crosshairs center-in-block" aria-hidden="true"></i></a>
Run Code Online (Sandbox Code Playgroud)
[注意,这里我们没有使用工具提示]
$(function() {
$(document).ready(function() {
xAxis: {
type: 'datetime',
crosshair: {
color: '#335A81',
label: {
enabled: true,
padding: 8,
}
},
},
yAxis: {
opposite: true,
crosshair: {
label: {
enabled: true,
format: '{value:.2f}'
}
},
)};
)};
Run Code Online (Sandbox Code Playgroud)
$('#toggle_tooltip').click(function(){
var chart = $("#tv_chart_container").highcharts();
var x_tool = chart.xAxis[0].crosshair.label.enabled;
var y_tool = chart.yAxis[0].crosshair.label.enabled
if(x_tool == true && y_tool == true)
{
chart.xAxis[0].crosshair.update({
enabled: false, …Run Code Online (Sandbox Code Playgroud) 我已经实施了HighStock图表,显示在:
http://www.highcharts.com/stock/demo/compare
此图表显示了从第一个或最左侧的数据点开始的百分比变化.我有一些股票分析师告诉我这没什么用,而且他们宁愿看到前一个数据点的百分比变化,换句话说,如果我在图表上看"今天",我会希望看到昨天的百分比变化.我查看了highstock API,我似乎找不到定义百分比变化函数的方法.是否有正确的方法让highstock做到这一点,还是应该使用highcharts折线图来实现这一目标?
我正在制作一个股票图表,我想按照这里的要求以编程方式显示highstock工具提示.
我设法解决了这个问题,但是现在,我的目标是显示所有系列的工具提示(当我用鼠标选择一个点时的行为相同 - 请查看此示例).
那可能吗?
这里是关键代码(更多代码):
xchart.tooltip.refresh([xchart.series[0].points[i]]);
//DOESN'T WORK
//chart.tooltip.refresh([chart.series.points[i]]);
//DOESN'T WORK ALSO
//chart.tooltip.refresh([chart.series[0].points[i]]);
//chart.tooltip.refresh([chart.series[1].points[i]]);
Run Code Online (Sandbox Code Playgroud) 我想用来chart.renderer.image在Yaxis上放置图片。请看这个小提琴
有没有简单的方法可以将图像放置在Yaxis上?例如,我想将图像放在Yaxis [0,100]上。使用以下方法很难做到这一点。
chart.renderer.image('http://highcharts.com/demo/gfx/sun.png', 0, 10, 30, 30)
.add();
Run Code Online (Sandbox Code Playgroud) 如何在Highstock(而不是Highcharts!)中显示日期的周数?
我的SQL看起来像这样
select unix_timestamp(date)*1000 week
(....)
group by yearweek(date,3)
Run Code Online (Sandbox Code Playgroud)
我的JS
$(function() {
$.getJSON('json_chart.php', function(data) {
// Create the chart
$('#container').highcharts('StockChart', {
rangeSelector : {
selected : 2
},
title : {
text : 'Wyniki'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%e'
}
},
yAxis: [{
offset: 40,
title: {
text: 'Ilo?c'
},
lineWidth: 2
}, {
title: {
text: 'Efek'
},
opposite: true,
}],
series : [{
name : 'Ode',
data : data.ode,
type : 'column', …Run Code Online (Sandbox Code Playgroud) 我有几个高档系列.在highcharts中,会自动生成一个图例,当我点击图例中的系列时,它会隐藏/显示它.
有没有办法在highstock中有相同的行为?我似乎无法找到这个功能.
谢谢