morris.js

Morris.js chart not working inside of a bootstrap tab

一世执手 提交于 2019-12-03 13:39:32
I have a situation where I am trying to use MorrisJS charts inside two different bootstrap tabs . The chart loads fine in the first (default) tab but when I click into the second tab the chart doesn't load properly at all. It is very odd as I am copying and pasting the exact same chart to be in the first and second tab but the second one isn't loading for me. Here is a link to a jsfiddle I setup. https://jsfiddle.net/phz0e68d/5/ Here is the code: HTML: <div> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#home" aria-controls="home"

Refresh morris chart using javascript

☆樱花仙子☆ 提交于 2019-12-01 13:12:33
问题 I have this morris chart that I would like to refresh using a javascript function. So I then can add a href link on the page that contains that javascript that will refresh the morris chart. <script type="text/javascript"> $.get('@Url.Action("GetData")', function (result) { Morris.Line({ element: 'samplechart', data: result, xkey: 'period', ykeys: ['a', 'b'], labels: ['YES', 'NO'], xLabelAngle: 60, parseTime: false, resize: true, lineColors: ['#32c5d2', '#c03e26'] }); }); </script> How would

morris.js Graph container element not found

↘锁芯ラ 提交于 2019-11-30 08:10:45
Why am I getting an exception Uncaught Error: Graph container element not found when using morris.js ? Gene Bo Solution: Put the javascript after the morris.js div From this post from tiraeth: https://github.com/morrisjs/morris.js/issues/137 Anatole Nkwadjo if don' t use the chart on this page, you can do this: Go to the line where the exception is throwed in morris.js change it like this: before: if (this.el === null || this.el.length === 0) { return; // throw new Error("Graph placeholder not found."); } I had this issue when I was using the node.js framework. Taking out the script tags

Load Morris.js graph in active tab (bootstrap)

两盒软妹~` 提交于 2019-11-29 17:57:39
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="height:200px;width:200px;"></div> </div> <div class="tab-pane" id="b"> <div id="tab-b" style="height

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

。_饼干妹妹 提交于 2019-11-29 14:45:54
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'], labels: ['A', 'B', 'C', 'D'], barColors: ['#0B62A4','#f75b68','#4DA74D','#646464'], hideHover: 'auto' });

morris.js Graph container element not found

别等时光非礼了梦想. 提交于 2019-11-29 10:50:48
问题 Why am I getting an exception Uncaught Error: Graph container element not found when using morris.js? 回答1: Solution: Put the javascript after the morris.js div From this post from tiraeth: https://github.com/morrisjs/morris.js/issues/137 回答2: if don' t use the chart on this page, you can do this: Go to the line where the exception is throwed in morris.js change it like this: before: if (this.el === null || this.el.length === 0) { return; // throw new Error("Graph placeholder not found."); }

R: interactive plots (tooltips): rCharts dimple plot: formatting axis

我们两清 提交于 2019-11-29 04:25:17
I have some charts created with ggplot2 which I would like to embed in a web application: I'd like to enhance the plots with tooltips. I've looked into several options. I'm currently experimenting with the rCharts library and, among others, dimple plots. Here is the original ggplot: Here is a first attempt to transpose this to a dimple plot: I have several issues: after formatting the y-axis with percentages, the data is altered. after formatting the x-axis to correctly render dates, too many labels are printed. I am not tied to dimple charts, so if there are other options that allow for an

Morris graphs. Have custom tooltip when hover

狂风中的少年 提交于 2019-11-28 09:18:05
I am using morris.js (which has a dependency on raphael) for creating stacked bar graphs. For each stacked bar I want to show the split for the various levels in the bar as a tooltip. I tried using the hoverCallback: but it doesn't seem to give me control over the particular element I am hovering over. I only get the content for that particular bar. I have setup a JSBIN example for the same here: When you hover over the bar it shows the index of the bar at the bottom. I want to show the content as a tool tip instead. JSBIN example Ruben Kazumov Piece of cake. Demo and code: <script type="text

Varying bar colors with morris.js bar chart?

◇◆丶佛笑我妖孽 提交于 2019-11-28 07:17:10
问题 I'm a JavaScript beginner using morris.js to create a bar chart where I need each bar containing a y value to be a different color. The code below shows what I've done so far Morris.Bar({ element: 'calls-made', data: [ { y: 'Person A', a: 10 }, { y: 'Person B', a: 15 }, { y: 'Person C', a: 12 }, { y: 'Person D', a: 20 } ], xkey: 'y', ykeys: ['a'], labels: ['Calls'], barColors: ["#B21516", "#1531B2", "#1AB244", "#B29215"], hideHover: 'always', }); I would like the bar for 'Person A' to be one

R: interactive plots (tooltips): rCharts dimple plot: formatting axis

回眸只為那壹抹淺笑 提交于 2019-11-27 18:24:21
问题 I have some charts created with ggplot2 which I would like to embed in a web application: I'd like to enhance the plots with tooltips. I've looked into several options. I'm currently experimenting with the rCharts library and, among others, dimple plots. Here is the original ggplot: Here is a first attempt to transpose this to a dimple plot: I have several issues: after formatting the y-axis with percentages, the data is altered. after formatting the x-axis to correctly render dates, too many