diff --git a/handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go b/handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go index dd0ee5f..835103a 100644 --- a/handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go +++ b/handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go @@ -94,12 +94,12 @@ func (tkf *TabKelainanFisikHandler) HandleShowTabKelainanFisik(c echo.Context) e } chartsxs := []templ.Component{ - chart.ShowChartFixed("bmixs", string(bmijson), "400px", "450px"), - chart.ShowChartFixed("hprxs", string(hiperjson), "400px", "450px"), - chart.ShowChartFixed("rfkxs", string(refraksijson), "400px", "450px"), - chart.ShowChartFixed("alkxs", string(alkoholjson), "400px", "450px"), - chart.ShowChartFixed("rkkxs", string(merokokjson), "400px", "450px"), - chart.ShowChartFixed("olhxs", string(olahragajson), "400px", "450px"), + chart.ShowChartFixed("bmixs", string(bmijson), "300px", "450px"), + chart.ShowChartFixed("hprxs", string(hiperjson), "300px", "450px"), + chart.ShowChartFixed("rfkxs", string(refraksijson), "300px", "450px"), + chart.ShowChartFixed("alkxs", string(alkoholjson), "300px", "450px"), + chart.ShowChartFixed("rkkxs", string(merokokjson), "300px", "450px"), + chart.ShowChartFixed("olhxs", string(olahragajson), "300px", "450px"), } chartsmd := []templ.Component{ @@ -112,12 +112,12 @@ func (tkf *TabKelainanFisikHandler) HandleShowTabKelainanFisik(c echo.Context) e } chartslg := []templ.Component{ - chart.ShowChartFixed("bmilg", string(bmijson), "600px", "450px"), - chart.ShowChartFixed("hprlg", string(hiperjson), "600px", "450px"), - chart.ShowChartFixed("rfklg", string(refraksijson), "600px", "450px"), - chart.ShowChartFixed("alklg", string(alkoholjson), "600px", "450px"), - chart.ShowChartFixed("rkklg", string(merokokjson), "600px", "450px"), - chart.ShowChartFixed("olhlg", string(olahragajson), "600px", "450px"), + chart.ShowChartFixed("bmilg", string(bmijson), "500px", "450px"), + chart.ShowChartFixed("hprlg", string(hiperjson), "500px", "450px"), + chart.ShowChartFixed("rfklg", string(refraksijson), "500px", "450px"), + chart.ShowChartFixed("alklg", string(alkoholjson), "500px", "450px"), + chart.ShowChartFixed("rkklg", string(merokokjson), "500px", "450px"), + chart.ShowChartFixed("olhlg", string(olahragajson), "500px", "450px"), } fisik, err := tkf.TabKelainanFisikServices.GetKelainanFisikPresentase(id) @@ -133,7 +133,7 @@ func (tkf *TabKelainanFisikHandler) HandleShowTabKelainanFisik(c echo.Context) e barchart := []templ.Component{ chart.ShowChartFixed("fislg", string(fisikjson), "1000px", "450px"), chart.ShowChartFixed("fismd", string(fisikjson), "500px", "450px"), - chart.ShowChartFixed("fisxs", string(fisikjson), "250px", "450px"), + chart.ShowChartFixed("fisxs", string(fisikjson), "350px", "450px"), } content := corporate_mcudetail.Tabkelainanfisik( diff --git a/handlers/corporate/mcudetail/tabkelainanlab.handlers.go b/handlers/corporate/mcudetail/tabkelainanlab.handlers.go index d5572a9..4ce93e4 100644 --- a/handlers/corporate/mcudetail/tabkelainanlab.handlers.go +++ b/handlers/corporate/mcudetail/tabkelainanlab.handlers.go @@ -107,11 +107,11 @@ func (tkl *TabKelainanLabHandler) HandleShowTabKelainanLab(c echo.Context) error chartslg := []templ.Component{ chart.ShowChartFixed("dataprelg", string(dataprejson), "1000px", "450px"), - chart.ShowChartFixed("hemalg", string(hemajson), "600px", "450px"), - chart.ShowChartFixed("urinlg", string(urinjson), "600px", "450px"), - chart.ShowChartFixed("hatilg", string(hatijson), "600px", "450px"), - chart.ShowChartFixed("lemaklg", string(lemakjson), "600px", "450px"), - chart.ShowChartFixed("glukoslg", string(glukosjson), "600px", "450px"), + chart.ShowChartFixed("hemalg", string(hemajson), "500px", "450px"), + chart.ShowChartFixed("urinlg", string(urinjson), "500px", "450px"), + chart.ShowChartFixed("hatilg", string(hatijson), "500px", "450px"), + chart.ShowChartFixed("lemaklg", string(lemakjson), "500px", "450px"), + chart.ShowChartFixed("glukoslg", string(glukosjson), "500px", "450px"), } content := corporate_mcudetail.TabKelainanLab( diff --git a/handlers/corporate/mcudetail/tabkelainannonlab.handlers.go b/handlers/corporate/mcudetail/tabkelainannonlab.handlers.go index beea047..2ad6f9d 100644 --- a/handlers/corporate/mcudetail/tabkelainannonlab.handlers.go +++ b/handlers/corporate/mcudetail/tabkelainannonlab.handlers.go @@ -78,7 +78,7 @@ func (tknl *TabKelainanNonLabHandler) HandleShowTabKelainanNonLab(c echo.Context } chartsxs := []templ.Component{ - chart.ShowChartFixed("datanonxs", string(dataprejson), "300px", "450px"), + chart.ShowChartFixed("datanonxs", string(dataprejson), "350px", "450px"), chart.ShowChartFixed("jantungxs", string(jantungjson), "300px", "450px"), chart.ShowChartFixed("thoraxxs", string(thrxjson), "300px", "450px"), chart.ShowChartFixed("spiroxs", string(autospirojson), "300px", "450px"), @@ -87,18 +87,18 @@ func (tknl *TabKelainanNonLabHandler) HandleShowTabKelainanNonLab(c echo.Context chartsmd := []templ.Component{ chart.ShowChartFixed("datanonmd", string(dataprejson), "500px", "450px"), - chart.ShowChartFixed("jantungmd", string(jantungjson), "500px", "450px"), - chart.ShowChartFixed("thoraxmd", string(thrxjson), "500px", "450px"), - chart.ShowChartFixed("spiromd", string(autospirojson), "500px", "450px"), - chart.ShowChartFixed("dengarmd", string(pendengaranjson), "500px", "450px"), + chart.ShowChartFixed("jantungmd", string(jantungjson), "450px", "450px"), + chart.ShowChartFixed("thoraxmd", string(thrxjson), "450px", "450px"), + chart.ShowChartFixed("spiromd", string(autospirojson), "450px", "450px"), + chart.ShowChartFixed("dengarmd", string(pendengaranjson), "450px", "450px"), } chartslg := []templ.Component{ chart.ShowChartFixed("datanonlg", string(dataprejson), "1000px", "450px"), - chart.ShowChartFixed("jantunglg", string(jantungjson), "600px", "450px"), - chart.ShowChartFixed("thoraxlg", string(thrxjson), "600px", "450px"), - chart.ShowChartFixed("spirolg", string(autospirojson), "600px", "450px"), - chart.ShowChartFixed("dengarlg", string(pendengaranjson), "600px", "450px"), + chart.ShowChartFixed("jantunglg", string(jantungjson), "500px", "450px"), + chart.ShowChartFixed("thoraxlg", string(thrxjson), "500px", "450px"), + chart.ShowChartFixed("spirolg", string(autospirojson), "500px", "450px"), + chart.ShowChartFixed("dengarlg", string(pendengaranjson), "500px", "450px"), } content := corporate_mcudetail.TabKelainanNonLab( diff --git a/handlers/corporate/mcudetail/tabkepesertaan.handlers.go b/handlers/corporate/mcudetail/tabkepesertaan.handlers.go index c4300c0..df0e514 100644 --- a/handlers/corporate/mcudetail/tabkepesertaan.handlers.go +++ b/handlers/corporate/mcudetail/tabkepesertaan.handlers.go @@ -66,9 +66,9 @@ func (tkh *TabKepersertaanHandler) HandleShowTabKepesertaan(c echo.Context) erro } chartsxs := []templ.Component{ - chart.ShowChartFixed("charttotalxs", string(totaljson), "400px", "450px"), - chart.ShowChartFixed("chartgenderxs", string(genderjson), "400px", "450px"), - chart.ShowChartFixed("chartumurxs", string(umurjson), "400px", "450px"), + chart.ShowChartFixed("charttotalxs", string(totaljson), "300px", "450px"), + chart.ShowChartFixed("chartgenderxs", string(genderjson), "300px", "450px"), + chart.ShowChartFixed("chartumurxs", string(umurjson), "300px", "450px"), } chartsmd := []templ.Component{ @@ -78,9 +78,9 @@ func (tkh *TabKepersertaanHandler) HandleShowTabKepesertaan(c echo.Context) erro } chartslg := []templ.Component{ - chart.ShowChartFixed("charttotal", string(totaljson), "600px", "450px"), - chart.ShowChartFixed("chartgender", string(genderjson), "600px", "450px"), - chart.ShowChartFixed("chartumur", string(umurjson), "600px", "450px"), + chart.ShowChartFixed("charttotal", string(totaljson), "500px", "450px"), + chart.ShowChartFixed("chartgender", string(genderjson), "500px", "450px"), + chart.ShowChartFixed("chartumur", string(umurjson), "500px", "450px"), } content := corporate_mcudetail.TabKepesertaan( diff --git a/models/chart.models.go b/models/chart.models.go index c29eb1c..693837a 100644 --- a/models/chart.models.go +++ b/models/chart.models.go @@ -49,6 +49,7 @@ type Piechart struct { type Barchart struct { Title struct { Text string `json:"text"` + Left string `json:"left"` } `json:"title"` Dataset struct { Source [][]interface{} `json:"source"` @@ -110,6 +111,7 @@ type BarDataset struct { type BarchartV2 struct { Title struct { Text string `json:"text"` + Left string `json:"left"` } `json:"title"` Dataset struct { Source [][]interface{} `json:"source"` diff --git a/services/corporate/mcudetail/tabkelainanfisik.services.go b/services/corporate/mcudetail/tabkelainanfisik.services.go index 9285f62..049ea15 100644 --- a/services/corporate/mcudetail/tabkelainanfisik.services.go +++ b/services/corporate/mcudetail/tabkelainanfisik.services.go @@ -103,18 +103,22 @@ func (tkf *TabKelainanFisikServices) GetBarChartConf(title string, data models.B option := models.Barchart{} option.Title = struct { Text string "json:\"text\"" - }{title} + Left string `json:"left"` + }{ + Text: title, + Left: "center", + } option.Dataset = data option.Grid.ContainLabel = true - option.XAxis.Name = "amount" + option.XAxis.Name = "person" option.YAxis.Type = "category" option.VisualMap.Orient = "horizontal" option.VisualMap.Left = "center" - option.VisualMap.Min = 10 - option.VisualMap.Max = 100 + option.VisualMap.Min = 0 + option.VisualMap.Max = 10 option.VisualMap.Show = false option.VisualMap.Dimension = 0 - option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"} + option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"} option.Series = []struct { Label struct { Position string "json:\"position\"" diff --git a/services/corporate/mcudetail/tabkelainanglobal.services.go b/services/corporate/mcudetail/tabkelainanglobal.services.go index 5c9cdd0..1021b54 100644 --- a/services/corporate/mcudetail/tabkelainanglobal.services.go +++ b/services/corporate/mcudetail/tabkelainanglobal.services.go @@ -30,18 +30,22 @@ func (tkg *TabKelainanGlobalServices) GetBarChartConf(title string, data models. option := models.Barchart{} option.Title = struct { Text string "json:\"text\"" - }{title} + Left string `json:"left"` + }{ + Text: title, + Left: "center", + } option.Dataset = data option.Grid.ContainLabel = true - option.XAxis.Name = "amount" + option.XAxis.Name = "person" option.YAxis.Type = "category" option.VisualMap.Orient = "horizontal" option.VisualMap.Left = "center" - option.VisualMap.Min = 10 - option.VisualMap.Max = 100 + option.VisualMap.Min = 0 + option.VisualMap.Max = 10 option.VisualMap.Show = false option.VisualMap.Dimension = 0 - option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"} + option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"} option.Series = []struct { Label struct { Position string "json:\"position\"" @@ -154,12 +158,12 @@ func (tkg *TabKelainanGlobalServices) GetKelainanGlobalMCU(mcuID string) (models } } - for _, d := range data { + for i, d := range data { percentage := float64(d.Total) / float64(max) * 100 roundedPercentage := math.Round(percentage*100) / 100 percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64) chartData.Source = append(chartData.Source, []interface{}{ - d.Total, d.Total, d.Test, percentStr, + i, d.Total, d.Test, percentStr, }) } @@ -302,12 +306,12 @@ func (tkg *TabKelainanGlobalServices) GetKelainanGlobalV2(mcuID string) (models. }, } - for _, d := range data { + for i, d := range data { percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100 roundedPercentage := math.Round(percentage*100) / 100 percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64) chartData.Source = append(chartData.Source, []interface{}{ - d.Mcu_KelainanID, d.Total, d.Test, percentStr, + i, d.Total, d.Test, percentStr, }) } diff --git a/services/corporate/mcudetail/tabkelainanlab.services.go b/services/corporate/mcudetail/tabkelainanlab.services.go index 3ea8a93..14c567d 100644 --- a/services/corporate/mcudetail/tabkelainanlab.services.go +++ b/services/corporate/mcudetail/tabkelainanlab.services.go @@ -30,18 +30,22 @@ func (tkl *TabKelainanLabServices) ConfBarchart(title string, data models.BarDat option := models.Barchart{} option.Title = struct { Text string "json:\"text\"" - }{title} + Left string `json:"left"` + }{ + Text: title, + Left: "center", + } option.Dataset = data option.Grid.ContainLabel = true - option.XAxis.Name = "amount" + option.XAxis.Name = "person" option.YAxis.Type = "category" option.VisualMap.Orient = "horizontal" option.VisualMap.Left = "center" - option.VisualMap.Min = 1 - option.VisualMap.Max = 100 + option.VisualMap.Min = 0 + option.VisualMap.Max = 10 option.VisualMap.Show = false option.VisualMap.Dimension = 0 - option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"} + option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"} option.Series = []struct { Label struct { Position string "json:\"position\"" @@ -136,7 +140,11 @@ func (tkl *TabKelainanLabServices) ConfBarchartVertical(title string, data []mod option := models.BarchartV2{ Title: struct { Text string "json:\"text\"" - }{title}, + Left string `json:"left"` + }{ + Text: title, + Left: "center", + }, Dataset: struct { Source [][]interface{} "json:\"source\"" }{chartData.Source}, @@ -198,7 +206,7 @@ func (tkl *TabKelainanLabServices) ConfBarchartVertical(title string, data []mod InRange: struct { Color []string "json:\"color\"" }{ - Color: []string{"#42aaf5", "#00eaf2", "#035bff"}, + Color: []string{"#035bff", "#42aaf5", "#00eaf2"}, }, }, Series: []struct { @@ -324,12 +332,12 @@ func (tkl *TabKelainanLabServices) GetDataPresentaseKelainanLab(mcuID string) (m return option, fmt.Errorf("error get jumlah peserta %v", err) } - for _, d := range data { + for i, d := range data { percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100 roundedPercentage := math.Round(percentage*100) / 100 percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64) chartData.Source = append(chartData.Source, []interface{}{ - d.Mcu_KelainanID, d.Total, d.Mcu_KelainanName, percentStr, + i, d.Total, d.Mcu_KelainanName, percentStr, }) } diff --git a/services/corporate/mcudetail/tabkelainannonlab.services.go b/services/corporate/mcudetail/tabkelainannonlab.services.go index 2712f66..9342870 100644 --- a/services/corporate/mcudetail/tabkelainannonlab.services.go +++ b/services/corporate/mcudetail/tabkelainannonlab.services.go @@ -30,18 +30,22 @@ func (tknl *TabKelainanNonLabServices) GetBarChartConf(title string, data models option := models.Barchart{} option.Title = struct { Text string "json:\"text\"" - }{title} + Left string `json:"left"` + }{ + Text: title, + Left: "center", + } option.Dataset = data option.Grid.ContainLabel = true - option.XAxis.Name = "amount" + option.XAxis.Name = "person" option.YAxis.Type = "category" option.VisualMap.Orient = "horizontal" option.VisualMap.Left = "center" - option.VisualMap.Min = 1 - option.VisualMap.Max = 100 + option.VisualMap.Min = 0 + option.VisualMap.Max = 4 option.VisualMap.Show = false option.VisualMap.Dimension = 0 - option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"} + option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"} option.Series = []struct { Label struct { Position string "json:\"position\"" @@ -143,7 +147,11 @@ func (tknl *TabKelainanNonLabServices) ConfBarchartVertical(title string, data [ option := models.BarchartV2{ Title: struct { Text string "json:\"text\"" - }{title}, + Left string `json:"left"` + }{ + Text: title, + Left: "center", + }, Dataset: struct { Source [][]interface{} "json:\"source\"" }{chartData.Source}, @@ -205,7 +213,7 @@ func (tknl *TabKelainanNonLabServices) ConfBarchartVertical(title string, data [ InRange: struct { Color []string "json:\"color\"" }{ - Color: []string{"#42aaf5", "#00eaf2", "#035bff"}, + Color: []string{"#035bff", "#42aaf5", "#00eaf2"}, }, }, Series: []struct { @@ -331,12 +339,12 @@ func (tknl *TabKelainanNonLabServices) GetDataKelNonLab(mcuID string) (models.Ba return option, fmt.Errorf("error get jumlah peserta %v", err) } - for _, d := range data { + for i, d := range data { percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100 roundedPercentage := math.Round(percentage*100) / 100 percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64) chartData.Source = append(chartData.Source, []interface{}{ - d.Mcu_KelainanID, d.Total, d.Test, percentStr, + i, d.Total, d.Test, percentStr, }) } diff --git a/views/corporate/dashboardpic/filterdashboardpic.templ b/views/corporate/dashboardpic/filterdashboardpic.templ index ded4d18..43d2d9b 100644 --- a/views/corporate/dashboardpic/filterdashboardpic.templ +++ b/views/corporate/dashboardpic/filterdashboardpic.templ @@ -11,7 +11,7 @@ templ FilterListing( ) {
- +
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/corporate/mcu/mcutabview.templ b/views/corporate/mcu/mcutabview.templ index da56100..9811bf2 100644 --- a/views/corporate/mcu/mcutabview.templ +++ b/views/corporate/mcu/mcutabview.templ @@ -6,67 +6,85 @@ templ TabViewMcuDetail(
- //
+
+ +
- //
+
+ +
- //
+
+ +
- //
+
+ +
- //
+
+ +
+
+ +
+
+ +
- //
+
+ +
} \ No newline at end of file diff --git a/views/corporate/mcu/mcutabview_templ.go b/views/corporate/mcu/mcutabview_templ.go index 60e5e5f..7004d6a 100644 --- a/views/corporate/mcu/mcutabview_templ.go +++ b/views/corporate/mcu/mcutabview_templ.go @@ -38,7 +38,7 @@ func TabViewMcuDetail( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#tabkepesertaan\" hx-trigger=\"load\">Peserta
  • Peserta
  • Kelainan global
  • Kelainan global
  • Kelainan Lab
  • Kelainan Lab
  • kelainan Non Lab
  • kelainan Non Lab
  • kelainan Fisik
  • kelainan Fisik
  • Kesimpulan
  • Kesimpulan
  • Daftar Peserta
  • Executive Summary
  • Daftar Peserta
  • Executive Summary
  • Keuangan
  • Keuangan
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\">
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }