Hi. May i get some help? why it still doesn't work? thanks for help.
my code:
<style>
</style>
<script src="/scripts/snippet-javascript-console.min.js?v=1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
Refresh Morris
<script type="text/javascript">
var morrisLine;
initMorris();
//getMorris();
getMorrisOffline();
function initMorris() {
morrisLine = Morris.Line({
element: 'samplechart',
xkey: 'period',
ykeys: ['a', 'b'],
labels: ['YES', 'NO'],
xLabelAngle: 60,
parseTime: false,
resize: true,
lineColors: ['#32c5d2', '#c03e26']
});
}
function setMorris(data) {
morrisLine.setData(data);
}
function getMorris() {
$.get('@Url.Action("GetData")', function (result) {
setMorris(result);
});
}
function getMorrisOffline() {
var lineData = [
{ period: '2006', a: 100, b: 90 },
{ period: '2007', a: 75, b: 65 },
{ period: '2008', a: 50, b: 40 },
{ period: '2009', a: 75, b: 65 },
{ period: '2010', a: 50, b: 40 },
{ period: '2011', a: 75, b: 65 },
{ period: '2012', a: 100, b: 40 }
];
setMorris(lineData);
}
</script>
index.txt
Hi. May i get some help? why it still doesn't work? thanks for help.
my code:
<style>function initMorris() {
morrisLine = Morris.Line({
element: 'samplechart',
xkey: 'period',
ykeys: ['a', 'b'],
labels: ['YES', 'NO'],
xLabelAngle: 60,
parseTime: false,
resize: true,
lineColors: ['#32c5d2', '#c03e26']
});
}
function setMorris(data) {
morrisLine.setData(data);
}
function getMorris() {
$.get('@Url.Action("GetData")', function (result) {
setMorris(result);
});
}
function getMorrisOffline() {
var lineData = [
{ period: '2006', a: 100, b: 90 },
{ period: '2007', a: 75, b: 65 },
{ period: '2008', a: 50, b: 40 },
{ period: '2009', a: 75, b: 65 },
{ period: '2010', a: 50, b: 40 },
{ period: '2011', a: 75, b: 65 },
{ period: '2012', a: 100, b: 40 }
];
setMorris(lineData);
}
</script>
index.txt