add line no dot, no curve

This commit is contained in:
skoo87 2013-09-27 22:10:34 +08:00
parent 3ad50dcb79
commit 3185c35342
2 changed files with 40 additions and 0 deletions

20
line_no_curve.go Normal file
View File

@ -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
}

20
line_no_dot.go Normal file
View File

@ -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
}