modify the title. and add the chart type to the title

This commit is contained in:
weizili.360.laptop 2014-12-28 11:04:09 +08:00
parent 9d8d8ed634
commit 01b8443b41
5 changed files with 12 additions and 7 deletions

2
.gitignore vendored
View File

@ -22,3 +22,5 @@ _testmain.go
*.exe
*.test
*.prof
download/win64/gochart/

View File

@ -1,6 +1,7 @@
package main
import (
"errors"
"github.com/zieckey/goini"
"os"
"path/filepath"
@ -54,5 +55,9 @@ func LookupChartFiles(dir string) ([]string, error) {
return nil
})
if len(files) == 0 {
return files, errors.New("Not found any *.chart files")
}
return files, err
}

View File

@ -1,7 +1,6 @@
package main
import (
"errors"
//"fmt"
"net/http"
"text/template"
@ -41,10 +40,8 @@ func ListenAndServe(addr string) error {
if err != nil {
return err
}
if len(ChartFiles) == 0 {
return errors.New("No chart data.")
}
// Register chart handlders
ChartHandlers["spline"] = new(SplineChart)
ChartHandlers["column"] = new(SplineChart)
ChartHandlers["area"] = new(SplineChart)

View File

@ -7,7 +7,7 @@ var TemplatePieHtml = `{{define "T"}}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example</title>
<title>Gochart - {{.ChartType}} | CodeG.cn</title>
<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">

View File

@ -8,7 +8,7 @@ var TemplateSplineHtml = `{{define "T"}}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highcharts Example</title>
<title>Gochart - {{.ChartType}} | CodeG.cn</title>
<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
@ -49,6 +49,7 @@ var TemplateSplineHtml = `{{define "T"}}
}]
},
tooltip: {
shared: true,
// valueSuffix: '°C'
valueSuffix: '{{.ValueSuffix}}'
},