zwxi 9 months ago
parent
commit
e48fbd09bd
2 changed files with 25 additions and 9 deletions
  1. 21 9
      models/data_manage/chart_theme/chart_theme.go
  2. 4 0
      services/data/chart_theme.go

+ 21 - 9
models/data_manage/chart_theme/chart_theme.go

@@ -150,7 +150,6 @@ func GetSystemChartTheme(chartThemeTypeId int) (item *ChartTheme, err error) {
 	return
 }
 
-
 type ColorsOptions []string
 
 type LegendOptions struct {
@@ -198,14 +197,15 @@ type LineOptions struct {
 }
 
 type OldChartOptions struct {
-	ColorsOptions []string    `json:"colorsOptions"`
-	LineOptions   LineOptions `json:"lineOptions"`
-	LegendOptions interface{} `json:"legendOptions"`
-	TitleOptions  interface{} `json:"titleOptions"`
-	MarkerOptions interface{} `json:"markerOptions"`
-	XAxisOptions  interface{} `json:"xAxisOptions"`
-	YAxisOptions  interface{} `json:"yAxisOptions"`
-	DrawOption    interface{} `json:"drawOption"`
+	ColorsOptions  []string           `json:"colorsOptions"`
+	LineOptions    LineOptions        `json:"lineOptions"`
+	LegendOptions  interface{}        `json:"legendOptions"`
+	TitleOptions   interface{}        `json:"titleOptions"`
+	MarkerOptions  interface{}        `json:"markerOptions"`
+	XAxisOptions   interface{}        `json:"xAxisOptions"`
+	YAxisOptions   interface{}        `json:"yAxisOptions"`
+	DrawOption     interface{}        `json:"drawOption"`
+	LineOptionList []LineStyleOptions `json:"lineOptionList"`
 }
 
 type NewChartOptions struct {
@@ -221,3 +221,15 @@ type NewLineOptions struct {
 	MarkSize  int    `json:"markSize"`
 	MarkColor string `json:"markColor"`
 }
+
+type LineStyleOptions struct {
+	DashStyle string `json:"dashStyle"`
+	Color     string `json:"color"`
+	LineWidth int    `json:"lineWidth"`
+	LineType  string `json:"lineType"`
+	Radius    int    `json:"radius"`
+	DataMark  string `json:"dataMark"`
+	MarkType  string `json:"markType"`
+	MarkSize  int    `json:"markSize"`
+	MarkColor string `json:"markColor"`
+}

+ 4 - 0
services/data/chart_theme.go

@@ -80,6 +80,10 @@ func ConvertOldChartOptions(config string) (newConfig string, err error) {
 	if err != nil {
 		return
 	}
+	if oldTheme.LineOptionList != nil && len(oldTheme.LineOptionList) > 0 {
+		newConfig = config
+		return
+	}
 	newTheme.OldChartOptions = oldTheme
 	for i := 0; i < 10; i++ {
 		newLineOption := chart_theme.NewLineOptions{