score:3
when you render the charts use this:
/*********************************************************
* generate the example chart
*********************************************************/
var chart = new highcharts.chart({
chart: {
renderto: 'container'
},
title: {
text: 'chart 1'
},
xaxis: {
categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
},
series: [{
type: 'arearange',
data: testdata,
fillcolor: {
pattern: 'http://i.stack.imgur.com/dezhe.png',
width: 10,
height: 300 + math.round(testdata[0][0] / 100) * 100
}
}]
});
var chart2 = new highcharts.chart({
chart: {
renderto: 'container2'
},
title: {
text: 'chart 2'
},
xaxis: {
categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
},
series: [{
type: 'arearange',
data: testdata2,
fillcolor: {
pattern: 'http://i.stack.imgur.com/dezhe.png',
width: 10,
height: 300 + math.round(testdata2[0][0] / 100) * 100
}
}]
});
it adds the y axis's starting point (math.round(testdata[0][0] / 100) * 100) to the height of the image.
(there is only a minor change to the code you supplied)
the difference is kinda subtle
score:3
you can also try to update position of the image after chart is rendered. only limit is to know one point (for example 1st pixel on top of pattern should be for value 500). see example: http://jsfiddle.net/ywuqd/9/
first add reference for future update when creating pattern:
this.upgradegradients = image;
then in load use this:
load: function() {
var chart = this,
image = chart.renderer.upgradegradients,
top = chart.yaxis[0].topixels(500), //500 is the top of image - only for example value
diff = chart.plottop + top;
image.attr({y : diff});
}
Source: stackoverflow.com
Related Query
- Control positioning of background image/pattern
- How to add a background image (pattern) to highchart column graph?
- highcharts change rendered image source on click
- Highcharts background image size option
- How can I add a background to a pattern in Highcharts?
- Background image isn't appearing in Highcharts
- Highcharts: circle with image background
- Strange character in the Highstock source code
- Highcharts - applying background image to container div
- Refresh (or change) background image dynamically
- How to insert a background image in r highcharts?
- Apply Background Image to A Column
- How to set background image on 3d highcharts?
- Highcharts Speedometer add image background
- JavaScript - Export Div with SVG chart + HTML as and Image
- Changing HighCharts background color?
- How to save an image of the chart on the server with highcharts?
- Capturing webpage as image in c#, ensuring javascript rendered elements are visible
- Highcharts: Add a custom image button
- Highcharts - Legend Positioning outside the chart
- Background color for multiple Highchart panes, in Vue app
- Optimize JavaScript DrillDown code
- Using a fill pattern instead of colour with HighCharts
- How to get an image watermark in HighCharts charts?
- Highcharts - change background color along specific date range
- Highcharts: Adding clickable image to every xAxis gridLine
- Export HighChart as an image in excel file together with the other page contents
- Highchart Pattern fill
- How to add image in Highcharts Title and subtitle
- Replacing highcharts.each in my code as it is being deprecated
More Query from same tag
- Highcharts mouse tracking behaviour with multiple arearange & line series
- Highcharts sunburst - override global colors
- use Highcharts Api to show multiples values
- One hyper link below each legend of pi-chart
- HighCharts animation android
- Radar Chart: Label outside the chart
- stop redrawing chart on highcharts
- Highcharts not displaying
- Highcharts - Rails array includes empty date entries
- very simple highcharts column graph with two arrays
- Highcharts data import JSON - formatting
- In highcharts how can I provide data with values x, y, title so that I can put the title in the tooltip?
- Hide linked series on legend hover in Highcharts
- highcharts not showing on heroku using python flask app
- Highcharts memory leak when using jQuery 2.X
- How to save and restore and Highstock chart with indicators?
- How to draw vertical lines on Highcharts graph?
- Highcharts - show at least 5 horizontal grid lines, even when value doesn't change
- Highcharts - TickInterval with datetime values
- Vue 3 how to correctly update data in Highcharts?
- Gantt highchart bar alignment issue
- HighCharts - show last labels in xAxis
- Highcharts Plotoptions Series
- Tooltip formatter for multiple axes in Highcharts.js
- Setting the width of a single bar in Highcharts
- Highcharts 12hr time format of x-axis labels
- Using redux data in JS object
- MySQL date shown as year in Highstock
- How to set dataLabel Format and axis label angle in R highcharter package
- Multiple xAxis line on Highcharts