From 3185c3534296e2f9ea4ab3c2976174bf814bbf63 Mon Sep 17 00:00:00 2001 From: skoo87 Date: Fri, 27 Sep 2013 22:10:34 +0800 Subject: [PATCH] add line no dot, no curve --- line_no_curve.go | 20 ++++++++++++++++++++ line_no_dot.go | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 line_no_curve.go create mode 100644 line_no_dot.go diff --git a/line_no_curve.go b/line_no_curve.go new file mode 100644 index 0000000..45c2110 --- /dev/null +++ b/line_no_curve.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" +) + +type LineNoCurveChart struct { + LineChart +} + +func (l *LineNoCurveChart) NewChart(name string) string { + return fmt.Sprintf("new Chart(document.getElementById(\"%s\").getContext(\"2d\")).Line(eval('('+lineJsonStr+')'), {pointDot:false, bezierCurve:false});", name) +} + +func init() { + line := new(LineNoCurveChart) + line.name = "line_no_curve" + + ChartHandlers["line_no_curve"] = line +} diff --git a/line_no_dot.go b/line_no_dot.go new file mode 100644 index 0000000..780c4e0 --- /dev/null +++ b/line_no_dot.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" +) + +type LineNoDotChart struct { + LineChart +} + +func (l *LineNoDotChart) NewChart(name string) string { + return fmt.Sprintf("new Chart(document.getElementById(\"%s\").getContext(\"2d\")).Line(eval('('+lineJsonStr+')'), {pointDot : false});", name) +} + +func init() { + line := new(LineNoDotChart) + line.name = "line_no_dot" + + ChartHandlers["line_no_dot"] = line +}