]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Merge 'Documentation updates' #3110
authorZach Panzarino <zachary@panzarino.com>
Wed, 10 Aug 2016 00:12:56 +0000 (00:12 +0000)
committerZach Panzarino <zachary@panzarino.com>
Wed, 10 Aug 2016 00:12:56 +0000 (00:12 +0000)
1  2 
docs/01-Chart-Configuration.md
docs/04-Bar-Chart.md
docs/09-Advanced.md

index 90f1efd8748d7d33c01ec69b4515fda1f51ca2b2,a6d62480e99bcda1febc6239d86804a376f461f0..7eef8c827928210923bc39850c9a513b9d63827d
@@@ -426,23 -425,34 +427,52 @@@ img.onload = function() 
          }
      })
  }
 +```
 +
 +Using pattern fills for data graphics can help viewers with vision deficiencies (e.g. color-blindness or partial sight) to [more easily understand your data](http://betweentwobrackets.com/data-graphics-and-colour-vision/).
  
 +Using the [Patternomaly](https://github.com/ashiguruma/patternomaly) library you can generate patterns to fill datasets.
 +
 +```javascript
 +var chartData = {
 +      datasets: [{
 +              data: [45, 25, 20, 10],
 +              backgroundColor: [
 +                      pattern.draw('square', '#ff6384'),
 +                      pattern.draw('circle', '#36a2eb'),
 +                      pattern.draw('diamond', '#cc65fe'),
 +                      pattern.draw('triangle', '#ffce56'),
 +              ]
 +      }],
 +      labels: ['Red', 'Blue', 'Purple', 'Yellow']
 +};
  ```
+ ### Mixed Chart Types
+ When creating a chart, you have the option to overlay different chart types on top of eachother as separate datasets.
+ To do this, you must set a `type` for each dataset individually. You can create mixed chart types with bar and line chart types.
+ When creating the chart you must set the overall `type` as `bar`.
+ ```javascript
+ var myChart = new Chart(ctx, {
+     type: 'bar',
+     data: {
+         labels: ['Item 1', 'Item 2', 'Item 3'],
+         datasets: [
+             {
+                 type: 'bar',
+                 label: 'Bar Component',
+                 data: [10, 20, 30],
+             },
+             {
+                 type: 'line',
+                 label: 'Line Component',
+                 data: [30, 20, 10],
+             }
+         ]
+     }
+ });
+ ```
Simple merge
Simple merge