Morris.js area graph customization

Morris.js area graph customization

By : RoRek
Date : November 18 2020, 03:49 PM
it should still fix some issue You can use a class instead of an id by passing morris a jQuery or DOM object. If you pass it a string, it must be an id. so you could use a class like this:
code :

Share : facebook icon twitter icon
Is there any way to make morris.js area chart gradient

Is there any way to make morris.js area chart gradient

By : user3638046
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I am using morris.js area chart to show weather report of a year. , Using the below method we can achieve the gradient fill
code :
Morris.Area.prototype.fillForSeries = function(i)  
var color;
return "10-#3b7078-#b6b120:40-#bc951c-#3b7078:90-#3b7078";
PHP: How do I create a Morris Area chart from this array?

PHP: How do I create a Morris Area chart from this array?

By : C Irene Jordan
Date : March 29 2020, 07:55 AM
this will help I'm trying to write a function which will convert my array in to json data to be used in to Morris Area charts The original array pulled from the database is as bellow: , You need to save the date too:
code :
function chartData($results) {
    $data = array();

    foreach($results as $result) {
        $t_date = $result['tracking_date'];

        if(!isset($data[$t_date])) {
            $data[$t_date] = array(
                'date' => $t_date,
                'human' => 0,
                'bots' => 0,

        $data[$t_date]['bots']  += $result['tracking_isbot'];
        $data[$t_date]['human'] += (1 - $result['tracking_isbot']);

    return $data;
How to change the filling area color in Morris.js

How to change the filling area color in Morris.js

By : arun kumar
Date : March 29 2020, 07:55 AM
Does that help Use the fillOpacity property (not fillingOpacity). Set a value between 0 and 1. If you set the property to 1, there's no transparency.
code :
  element: 'chart',
  data: [
    { y: '2015-01', a: 1, b: 2 },
    { y: '2015-02', a: 2,  b: 3 },
    { y: '2015-03', a: 2,  b: 2 },
    { y: '2015-04', a: 1,  b: 4 },
    { y: '2015-05', a: 2,  b: 5 },
    { y: '2015-06', a: 3,  b: 3 },
    { y: '2015-07', a: 1, b: 2 }
  xkey: 'y',
  ykeys: ['a', 'b'],
  labels: ['Individual Score', 'Team Score'],
  fillOpacity: 0.4,
  hideHover: 'auto',
  behaveLikeLine: true,
  resize: true,
  pointFillColors: ['#ffffff'],
  pointStrokeColors: ['black'],
  lineColors: ['red', 'blue'],
<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>
<link href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css" rel="stylesheet"/>

<div id="chart"></div>
ASP.NET MVC serialize data to morris area chart

ASP.NET MVC serialize data to morris area chart

By : Suresh Rampaul
Date : March 29 2020, 07:55 AM
hope this fix your issue Solution is to use this, because you have already returned a json array using ajax call. So, you do not need data:[result],all you need is data:result.
code :
new Morris.Area({
          // ID of the element in which to draw the chart.
          element: 'area-example',
          // Chart data records -- each entry in this array corresponds to a point on
          // the chart.
          data: result,
          // The name of the data record attribute that contains x-values.
          xkey: 'label',
          ykeys: ['value'],
          labels: ['Success requests'],
          pointSize: 2,
          hideHover: 'auto',
          resize: true
morris chart days customization issue

morris chart days customization issue

By : Rickard Sjöström
Date : March 29 2020, 07:55 AM
I wish this help you Firstly note that getDay() starts at 0 for Sunday, so your array of day names should do the same to keep it consistent.
As for the actual issue, that's because you've set the labels to display at an angle and there is physically not enough space on the left to show one.
code :
var weekdays = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];

  element: 'myfirstchart',
  data: [{
      "period": "2018-02-26",
      "total": 4
      "period": "2018-02-27",
      "total": 2
      "period": "2018-02-28",
      "total": 5
      "period": "2018-03-01",
      "total": 9
      "period": "2018-03-02",
      "total": 15
      "period": "2018-03-03",
      "total": 12
    }, {
      "period": "2018-03-04",
      "total": 12
  lineColors: ['#f5901a', '#fc8710', '#FF6541', '#A4ADD3', '#766B56'],
  xkey: 'period',
  ykeys: ['total'],
  labels: ['Total'],
  xLabels: 'day',
  xLabelFormat: function(d) {
    return weekdays[d.getDay()];
  resize: true
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/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>

<div id="chart_div" style="width: 100%; height: 300px;">
  <div class="chart-title">Client Registrations</div>
  <div id="myfirstchart" style="height: 250px;"></div>
Related Posts Related Posts :
  • React | Can´t load Images > Module not found
  • Dynamically creating buttons in DOJO
  • 404 Not Found in AJAX post call
  • How do I find out, using javascript, what software opened and running my application?
  • Javascript to check the status of wireless connection
  • StarDict support for JavaScript and a Firefox OS App
  • Phonegap event Resume
  • call javascript function on ENTER key press?
  • When is the best time to remove no-js classes from the html tag
  • Recommended email sending languages
  • setInterval not working properly with chrome
  • Does IE create new scope for each script tag?
  • Uncaught SyntaxError: Unexpected token < Underscore and parse issues
  • How to pass captured URL to Email Body in HTML
  • How to structure default nested resources?
  • Store all the keys of a JSON object in a variable
  • Need an efficient way to group the Array of object in javascript
  • a sensible approach to highcharts x-axis labels
  • IDE autocompletion for javascript AMD loading style
  • Bootstrap menu disappears after first click setting the ul style to none
  • split ajax json response errors in each field
  • how to add javascript in head in cmsms
  • REGEX: Finding the correct occurrence order of some given special characters in a string
  • How do you preserve a JavaScript date's time zone from browser to server, and back?
  • Return binary result from phantomjs webserver
  • must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
  • Replacing a substring of an element's text with another string
  • How do I filter marks greater than or equal to 90 in this array?
  • Modify the text of my radio input button?
  • Clicking on status bar does not scroll to top of app (Trigger.io)
  • Mocha JS: How to highlight specific assertion failure?
  • $.getJSON jquery parsing to HTML
  • Find items of a certain class (a) that are also in other classes (b,c,d)
  • Setting different images for D3 force-directed layout nodes
  • Integrating Dropzone.js with angular
  • Control sprite animation speed
  • Can only one error / success function be assigned for AngularJS $http promises?
  • Working with math in javascript
  • Django variable isnt recognized by javascript
  • $.when does not work with $.scrollTo plugin
  • How to read local xml file using $.ajax?
  • Manifest is not Valid JSON. What is wrong?
  • AngularJS re-initialise JS after statechange
  • WebRupee is not working
  • How can I make the jQuery MultiSelect widget read-only?
  • How to associate javascript code with dom elements?
  • How to remove track from MediaStream and "stop" webcam?
  • clearvalidators not working in angular 6 form control
  • Remove Count Attribute in json data
  • queue up function callbacks
  • How to stop all Soundcloud streams in once?
  • Sliding div onclick left/right
  • RequireJS JQuery shim doesnt work with VS2013
  • What is the Meteor concurrency model?
  • Events on children of contenteditable element
  • Simple jquery not working to print the input value
  • Javascript templating language in reverse
  • Making Pagination in Javascript Scalable (for large # of db results)
  • Performance of Stateless Authentication in SPA and SSO (Single Sign On)
  • Assigning a value for view asynchronously
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org