JSFiddle - React, Tailwind, and code Playground
HTML
<h2>TEST</h2>
<h2>Radar Chart with dimmed background</h2>
<div id="chart12"></div>
<script>
var options = {
'legend':{
names: ['Perceivable', 'Information', 'Understandable', 'Enough', 'Epilepsy', 'Operable', 'Navigation','Error'],
hrefs: []
},
'dataset': {
title: 'Web accessibility status',
values: [['n/a',53,67,23,78, 55, 45, 89]],
bgColor: '#f9f9f9',
fgColor: '#cc79a7'
},
'chartDiv': 'chart12',
'chartType': 'radar',
'chartSize': {width:600, height:300}
};
Nwagon.chart(options);
</script>
<h2>Radar Chart</h2>
<div id="chart11"></div>
<script>
var options = {
'legend':{
names: ['Perceivable', 'Information', 'Understandable', 'Enough', 'Epilepsy', 'Operable', 'Navigation','Error'],
hrefs: []
},
'dataset': {
title: 'Web accessibility status',
values: [[33,53,67,23,78,45,69, 89], [53,67,23,78,45,69, 89, 33]],
bgColor: '#f9f9f9',
fgColor: '#cc79a7'
},
'chartDiv': 'chart11',
'chartType': 'radar',
'chartSize': {width:600, height:300}
};
Nwagon.chart(options);
</script>
<h2>Line Chart with guide line
</h2>
<div id="chart71"></div>
<p style = 'font-size:12px; padding:0 0 40px 40px'>** Mouse over the chart area in order to move the guide line</p>
<script>
var options = {
'legend':{
names: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15',]
},
'dataset':{
title:'Playing time per day',
values: [[56,76], [58,66], [60,62], [58,70], [85, 76], [86,83], [82, 73], [77,66], [87,66], [49,56], [58,76], [85, 76], [56,83], [56, 83], [45, 34]],
colorset: ['#0072b2', '#cc79a7'],
fields:['Company A', 'Company B']
},
'chartDiv' : 'chart71',
'chartType' : 'line',
'leftOffsetValue': 40,
'bottomOffsetValue': 60,
'chartSize' : {width:700, height:300},
'minValue' :0,
'maxValue' : 100,
'increment' : 20,
'isGuideLineNeeded' : true //default set to...
CSS
@charset "utf-8";
v\:group,
v\:shape,
v\:line,
v\:polyline,
v\:rect,
v\:oval,
v\:fill {
behavior : url(#default#VML);
}
v\: * {behavior : url(#default#VML);}
/*common*/
.background text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px}
ul.accessibility {font-size: 1px;height: 1px; line-height: 1px; overflow: hidden; width: 1px;}
.background .fields text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px}
.foreground .labels text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px}
.tooltip text{fill:#777;font-family:'나눔고딕', '돋움', Dotum;font-size: 11px;}
.tooltip rect{fill:rgba(255,255,255,0.9);stroke:#ccc;stroke-width:0.5;}
.fields text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px}
.guide_line{stroke:#4010ad;stroke-width:1}
/* Column Type */
.Nwagon_column .background line.h{stroke:#000;stroke-width:0.2;}
.Nwagon_column .background line.v{stroke:#000;stroke-width:0.1;}
.Nwagon_column .foreground .columns g rect{fill-opacity:0.7;cursor:pointer;}
.Nwagon_column .foreground .tooltip text{fill:#777;font-family:'나눔고딕', '돋움', Dotum;font-size: 9px;}
.Nwagon_column .foreground .tooltip rect{fill:rgba(255,255,255,0.9);stroke:#ccc;stroke-width:0.5;}
.Nwagon_column .labels text, .Nwagon_column .background text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px;}
/*stacked_column*/
.Nwagon_stacked_column .background line.h{stroke:#000;stroke-width:0.2;}
.Nwagon_stacked_column .background line.v{stroke:#000;stroke-width:0.1;}
.Nwagon_stacked_column .foreground .columns g rect{fill-opacity:0.7;cursor:pointer;}
.Nwagon_stacked_column .foreground .tooltip text{fill:#777;font-family:'나눔고딕', '돋움', Dotum;font-size: 9px;}
.Nwagon_stacked_column .foreground .tooltip rect{fill:rgba(255,255,255,0.9);stroke:#ccc;stroke-width:0.5;}
.Nwagon_stacked_column .labels text, .Nwagon_stacked_column .background text{fill:#666;font-family:'나눔고딕', '돋움', Dotum;font-size:11px;}
/*multi_column*/
.Nwagon_multi_column .background...
JavaScript
/*Copyright (c) 2013 NTS Corp. All Rights Reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/*Developed by Insook Choe ([email protected]), Inho Jung([email protected])*/
var CONST_SVG_URL = 'http://www.w3.org/2000/svg';
var VML_NAME_SPACE = 'urn:schemas-microsoft-com:vml'
var CONST_MAX_RADIUS = 100;
var CONST_DECREMENT = 20;
var Nwagon = {
chart: function(options){
var isIE_old = false;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
var ieversion = new Number(RegExp.$1); // capture x.x portion and store as a number
if (ieversion <= 8){
isIE_old = true;
if(!document.namespaces['v']) {
document.namespaces.add('v', VML_NAME_SPACE);
}
}
}
var chartObj = new Object();
chartObj.chartType = options['chartType'];
chartObj.dataset = options['dataset'];
chartObj.legend = options['legend'];
chartObj.width =...