It is currently Mon Jul 28, 2014 4:23 pm Advanced search

defining yAxis height and top as %

Technical support for the Highcharts Stock package

defining yAxis height and top as %

Postby trophyman » Thu Feb 23, 2012 12:37 am

In this online demo, http://highcharts.com/stock/demo/candlestick-and-volume , I need to be able to define each yAxis 'height' and 'top' properties as a percentage and not a fixed number since I do not know what the height of my chart will be. I need to be able to adjust based on how the user has sized the chart.

Code: Select all
yAxis: [{
              title: {
                  text: 'OHLC'
              },
              height: 200,
              lineWidth: 2
          }, {
              title: {
                  text: 'Volume'
              },
              top: 300,
              height: 100,
              offset: 0,
              lineWidth: 2
          }],
trophyman
 
Posts: 25
Joined: Sat Jan 22, 2011 5:29 pm

Re: defining yAxis height and top as %

Postby hfrntt » Sun Feb 26, 2012 10:07 pm

Unfortunately it's not possible, you can use just integers there. But few months ago I made this demo: http://jsfiddle.net/hfrntt/uwznB as you can see it's possible to change axes height in a runtime, so you can try to calculate pixel values and update height.
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: defining yAxis height and top as %

Postby kylegetz » Tue Mar 20, 2012 1:35 am

I'm faced with a similar issue and was redirected here from my original post (viewtopic.php?f=12&t=16064). I just tried running the demo posted above and it fails with this error:

Timestamp: 3/19/2012 4:31:29 PM
Error: Highcharts is not defined
Source File: http://fiddle.jshell.net/_display/
Line: 22

Would it be possible for you to fix the demo?
kylegetz
 
Posts: 141
Joined: Wed Oct 12, 2011 12:24 am

Re: defining yAxis height and top as %

Postby hfrntt » Mon Mar 26, 2012 12:54 am

It just didn't load highstock.js, here is updated demo the: http://jsfiddle.net/hfrntt/uwznB/3/ (also that demo is buggy, when you move the chart up and down more times you'll see what I meant :) but it was just proof of concept)
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am


Return to Highstock Usage

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests