Design
Colour Palette
Requirments
To be user friendly, the ACE charts colour palette has the following requirements:
- A colour set large enough to accomodate multiple data series
- It must be easy to differentiate between the colours, including the following:
- Easy to differentiate when printed in greyscale
- Easier to differentiate for colour blindness
-
Distinct from the main ACE colour palette.
It needs to stand out from the page structure and avoid confusion with the semantics of ACE colours, p.ace-particularly from the success and error semantics.
Colour palette theory
The colour palette chosen is based on the cubehelix colour system.
This system accomodates for the different perception of colours in human vision compared to common computed colour scales,
p.ace-particularly in percieving the weight of colour saturation and brightness.
It is designed to be monotonically increasing in terms of its perceived brightness.
In this way, cubhelix contrasts the interpolation methods of
RGB, HSL and HCL which do not accomodate specfically for greyscale printing or vision impairment.
Cubehelix has the following unique features:
- Each colour is distinct in greyscale printing. (see Cubehelix, or How I Learned to Love Black & White Printers)
- Colour blindness is less affected (including protanopia, deutanopia, and tritanopia). (see above link)
- A cubehelix scale produces a more balanced and brigher "perceptual rainbow" than other methods. (see A Less-Angry Rainbow)
- It was designed specfically for human readable charting. (see Cambridge paper)
Colours
The spefic palette chosen accomodates up to twelve data series. (see cubehelix3_16)
- #00443C
- #005083
- #034BCA
- #483CFC
- #9C2BFF
- #EB24F4
- #FF2DC2
- #FF4986
- #FF7356
- #FFA443
- #EBD155
- #D3F187
Palette use in charting
Linear
Charts showing a graduating change in values should display the colours in the linear order.
This can be approiate when representing distribution data such as with a column or line histogram, scatter chart, or gauge.
Sequenced
Most chart types best represent data with colours in a non-linear sequence.
This maximises our ability to visually differentiate between each data series.
The sequenced colour palette can be appropiate when representing composition data such as with a pie or stacked column chart; when representing relationship data such as with a scatter or bubble chart; and when representing comparison data such as with a line or bar chart.
( Fun: The twelve palette colours are sequenced in cyclic fifth inteverals. This order maximises the ability to distinguish between every colour that proceeds and follows it. This is the same as the circle of fifths in music theory )
Screen | Greyscale printing |
---|---|
Linear colour wheel |
Linear desaturated wheel |
Sequenced colour wheel |
Sequenced desaturated wheel |
Code
Example | Code |
---|---|
Line chart |
Markup
JavaScript
|
Line chart with custom colours, interactive legend and guidelines |
Markup
JavaScript
|
Pie chart |
Markup
JavaScript
|
Doughnut chart |
Markup
JavaScript
|
Usage
Include ace-charts-with-dependencies.css after ace.css
<link rel="stylesheet" href="dist/ace.css" media="all">
<link href="dist/extensions/ace-charts-with-dependencies.css" rel="stylesheet">
Include ace-charts-with-dependencies.js after ace.js
<script src="dist/ace.js"></script>
<script src="dist/extensions/ace-charts-with-dependencies.js"></script>
Call the chart library using this format:
ACE.Chart
.<chart-name>( <svg-selector-string>
, <data-array>
, <configuration-object>
);
e.g.
<script>
ACE.Chart
.Doughnut( '#my-chart svg'
, [ { "label": "Hello", "value" : 12 }
, { "label": "There", "value" : 34 }
, { "label": "World", "value" : 56 }
]
, { showLegend : true }
);
</script>
Chart Attributes
All charts
Attribute | Examples | Description |
---|---|---|
palette
|
{ palette : 'sequenced' } { palette : 'linear' }
|
Optional: Sets the colour palette. Defaults to sequened. |
colourOffset
|
{ colourOffset : 7 }
|
Optional: Sets the starting offset for the colour palette. |
manualColour
|
{ manualColour : true }
|
Optional: When true you need to add your own color property to the dataset. |
Line chart
Attribute | Examples | Description |
---|---|---|
guidelines
|
{ guidelines : true }
|
Optional: Show interactive guidelines. Defaults to false. |
showLegend
|
{ showLegend : true }
|
Optional: Show interactive legend. Defaults to false. |
xAxisLabel
|
{ xAxisLabel : 'Time (hours)' }
|
Text for the x-axis. |
yAxisLabel
|
{ yAxisLabel : 'Value (AUD)' }
|
Text for the y-axis. |
Pie chart
Attribute | Examples | Description |
---|---|---|
showLabels
|
{ showLabels : true }
|
Optional: Show outside labels. Defaults to false. |
showLegend
|
{ showLegend : true }
|
Optional: Show interactive legend. Defaults to false. |
legendPosition
|
{ legendPosition : 'top' } { legendPosition : 'right' }
|
Optional: Sets the legend position. Defaults to right. |
Doughnut chart
Attribute | Examples | Description |
---|---|---|
half
|
{ half : true }
|
Optional: Show doughnut as a semicircle. Defaults to false. |
showLabels
|
{ showLabels : true }
|
Optional: Show outside labels. Defaults to false. |
showLegend
|
{ showLegend : true }
|
Optional: Show interactive legend. Defaults to false. |
legendPosition
|
{ legendPosition : 'top' } { legendPosition : 'right' }
|
Optional: Sets the legend position. Defaults to right. |
tooltipContent
|
{ tooltipContent : tip => tip.data.label }
|
Optional: Function to change tooltip content. |