forked from joewalnes/smoothie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for lineDash property for accessibility (#1)
Currently only supported for charts using a fixed y-axis and linear interpolation. Variation in axis height and different methods of interpolation affect the lineDashOffset property which represents the length of the line that overflows the canvas produced from old data. A new example has been added to demonstrate the feature.
- Loading branch information
1 parent
96626af
commit f70976f
Showing
3 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="../smoothie.js"></script> | ||
<script type="text/javascript"> | ||
// Randomly add a data point every 500ms | ||
var random = new TimeSeries(); | ||
setInterval(function () { | ||
random.append(Date.now(), Math.random() * 10000); | ||
}, 500); | ||
|
||
function createTimeline() { | ||
var chart = new SmoothieChart({tooltipLine:{strokeStyle:'#bbbbbb'},minValue:-10000,maxValue:10000}), | ||
canvas = document.getElementById('smoothie-chart'), | ||
series = new TimeSeries(); | ||
|
||
chart.addTimeSeries(random, {lineWidth:2,strokeStyle:'#00ff00',interpolation:'linear', lineDash: [10, 5]}); | ||
chart.streamTo(canvas, 500); | ||
} | ||
</script> | ||
</head> | ||
<body onload="createTimeline()" style="background-color: #333333"> | ||
<canvas id="smoothie-chart" width="500" height="100"> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters