forked from highcharts/highcharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a sample to test Highcharts with Browserify.
- Loading branch information
1 parent
83c3a88
commit fbca0f1
Showing
7 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,4 @@ nbproject/ | |
*.access_log | ||
|
||
*.log | ||
samples/highcharts/common-js/browserify/demo.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* eslint-env node*/ | ||
// Require dependencies | ||
var standalone = require('../../../../js/adapters/standalone-framework.src'), | ||
Highcharts = require('../../../../js/highcharts.src'); | ||
// Load the HighchartsAdapter | ||
Highcharts = new Highcharts(standalone); | ||
|
||
QUnit.test("Check if Highcharts is loaded properly.", function (assert) { | ||
var chart = new Highcharts.Chart({ | ||
chart: { | ||
renderTo: 'container' | ||
}, | ||
title: { | ||
text: 'Monthly Average Temperature', | ||
x: -20 //center | ||
}, | ||
subtitle: { | ||
text: 'Source: WorldClimate.com', | ||
x: -20 | ||
}, | ||
xAxis: { | ||
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | ||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] | ||
}, | ||
yAxis: { | ||
title: { | ||
text: 'Temperature (°C)' | ||
}, | ||
plotLines: [{ | ||
value: 0, | ||
width: 1, | ||
color: '#808080' | ||
}] | ||
}, | ||
tooltip: { | ||
valueSuffix: '°C' | ||
}, | ||
legend: { | ||
layout: 'vertical', | ||
align: 'right', | ||
verticalAlign: 'middle', | ||
borderWidth: 0 | ||
}, | ||
series: [{ | ||
name: 'Tokyo', | ||
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6] | ||
}, { | ||
name: 'New York', | ||
data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5] | ||
}, { | ||
name: 'Berlin', | ||
data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0, 18.6, 17.9, 14.3, 9.0, 3.9, 1.0] | ||
}, { | ||
name: 'London', | ||
data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8] | ||
}] | ||
}); | ||
|
||
assert.strictEqual( | ||
window.HighchartsAdapter, | ||
undefined, | ||
"No global HighchartsAdapter variable." | ||
); | ||
|
||
assert.strictEqual( | ||
window.Highcharts, | ||
undefined, | ||
"No global Highcharts variable." | ||
); | ||
|
||
assert.strictEqual( | ||
Highcharts.product, | ||
'Highcharts', | ||
'Highcharts is loaded' | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.warning { | ||
background-color: #f0ad4e; | ||
color: white; | ||
padding: 15px; | ||
font-size: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: Highcharts Browserify Demo | ||
authors: | ||
- Jon Arild Nygård | ||
resources: | ||
- http://code.jquery.com/qunit/qunit-1.19.0.js | ||
- http://code.jquery.com/qunit/qunit-1.19.0.css | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
|
||
<p class="warning">This sample will check if Highcharts works properly with Browserify. Before running this test, run "gulp common" in command line first.</p> | ||
<div id="container" style="width: 600px;"></div> |