morris.js

Morris line chart

倾然丶 夕夏残阳落幕 提交于 2019-12-25 01:22:07
问题 i am using morris line chart in my application, Here everything is complete but on x axis i wrote 1 then it display 1910 but i want there current month and date not year. means i want date in place of list of year. Here is my code: Morris.Line({ element: 'line-example', data: [ { time: '1', a: 0, b: 0 }, { time: '2', a: 0, b: 0 }, { time: '3', a: 0, b: 0 }, { time: '4', a: 0, b: 0 }, { time: '5', a: 0, b: 0 }, { time: '6', a: 0, b: 0 }, { time: '7', a: 0, b: 0 }, { time: '8', a: 0, b: 0 }, {

Morris chart with dynamic data

橙三吉。 提交于 2019-12-24 12:38:58
问题 I used Morris chart in my application project to show some details about quantity of sales. After executing the AJAX request, the chart is showing data in disordered way.It doesn't display sales for each city.I want to display them like this example with static data http://jsfiddle.net/marsi/LaJXP/1/ var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': 'sales.php', 'dataType': "json", 'success': function (data) { json = data; } }); return json; }) ();

morris chart not updating

我怕爱的太早我们不能终老 提交于 2019-12-24 08:23:55
问题 I have a problem with updating my morris.js bar chart. When the page loads, I have the following function, which works fine and creates a nice chart: $(document).ready(function() { if($('.projectViewTotal').length) { chart = Morris.Bar({ element: 'LastIncome', data: [ { y: '04-02-2014', a: 3 }, { y: '04-03-2014', a: 10 }, { y: '04-04-2014', a: 5 }, { y: '04-05-2014', a: 17 }, { y: '04-06-2014', a: 6 } ], xkey: 'y', ykeys: ['a'], labels: ['Visits'] }); }; }); Then after some user action I get

Script isn't answering any more error using morris.js in firefox

匆匆过客 提交于 2019-12-24 02:13:58
问题 I am using the library morris.js http://www.oesmith.co.uk/morris.js/ in order to create charts for a website. It works on Opera, Internet Explorer and Google Chrome. In Firefox, it randomly crashes instantly. Script Panel tells me, it crashes here: secondsSpecHelper = function(interval) { return { span: interval * 1000, start: function(d) { return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes()); }, fmt: function(d) { return "" + (Morris.pad2(d.getHours())) +

Morris chart to fetch data from a local JSON file

给你一囗甜甜゛ 提交于 2019-12-23 02:58:39
问题 I am trying to create a morris donut chart. I have modified it to get data from a local json file, but for some reason it doesnt load the chart.No error in the console also. Here is the html file <meta charset=utf-8 /> <title>Morris.js Donut Chart Example</title> </head> <body onLoad="drawChart()"> <div id="donut-example"></div> </body> <script> function drawChart() { var jsonData = $.getJSON("data.json", function(json) { console.log(json); // show the info in console }); Morris.Donut({

morris.js issue with hours on x-axis

ε祈祈猫儿з 提交于 2019-12-22 04:51:06
问题 I am trying to create something like the google analytics Audience Overview graph. I am trying to put Hours starting from 12:00am midnight to 11:00pm on the x-axis This is what I am currently using: Morris.Line({ element: 'chart_div_compare', data: [ { hours: '00:00', a: 793, b: 729}, { hours: '01:00', a: 524, b: 537}, { hours: '02:00', a: 337, b: 347}, { hours: '03:00', a: 272, b: 213}, { hours: '04:00', a: 176, b: 169}, { hours: '05:00', a: 174, b: 147}, { hours: '06:00', a: 212, b: 193}, {

Integers as y-axis in a morris.js line chart

左心房为你撑大大i 提交于 2019-12-22 04:42:52
问题 I have started using morris.js line chart in my html page. Is there a way to set the y-axis to only contain integers? Now it displays decimal numbers, but my data set only contains integers. 回答1: This feature was added by this pull request about 25 days ago on the Github repository. It added the option gridIntegers that, by default, is set to false . It is still not merged to the main repository. Therefore, if you want to use it right now, you have to download this version and configure like

Morris.js bar chart not rendering hover over text

穿精又带淫゛_ 提交于 2019-12-21 20:12:07
问题 I am using Morris.js Bar chart. For some reason, the numbers that were supposed to come on HOVER OVER are being listed on bottom left. Does any one why? 回答1: Without any code it's hard to give a good answer. But, it has probably something to do with your CSS files. Morris users this to place the hoover CSS .morris-hover{position:absolute;z-index:1000;} JS morris.hover.coffee Perhaps you have some CSS that conflicts with this? 回答2: Yeah true the problem must be with css. Make sure that you

Load Morris.js graph in active tab (bootstrap)

偶尔善良 提交于 2019-12-18 09:49:11
问题 I have 2 tabs with 1 morris.js graph in each. The Graph in the first (active) tab loads perfectly, but the graph in the second tab doesn't load (strange result in Chrome, nothing in Firefox). See jsbin: http://jsbin.com/canajije/1/edit <div class="row"> <ul class="nav nav-tabs nav-justified"> <li ><a href="#a" data-toggle="tab">Tab A</a></li> <li><a href="#b" data-toggle="tab">Tab B</a></li> </ul> <div class="tab-content col-sm-12" > <div class="tab-pane active" id="a"> <div id="tab-a" style=

How to increase width of morris.js bar or add space between bars?

ε祈祈猫儿з 提交于 2019-12-18 08:53:04
问题 I have this morris.js bar with multiple bars, i want to change width of the bars or make space between durations. From the below image is there a way to provide either more space between Feb March and April or is there a way to adjust bar widths? Here is my code Morris.Bar({ element: 'morris-chart-bar', data: [ { y: 'Feb', a: 75, b: 60, c: 5, d: 50 }, { y: 'March', a: 180, b: 220, c: 140, d: 160 }, { y: 'April', a: 300, b: 340, c: 350, d: 270 } ], xkey: 'y', ykeys: ['a', 'b', 'c', 'd'],