chart_info.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package chart_info
  2. import (
  3. "hongze/hongze_yb/models/request"
  4. responseModel "hongze/hongze_yb/models/response"
  5. "hongze/hongze_yb/models/tables/chart_edb_mapping"
  6. "hongze/hongze_yb/models/tables/chart_info"
  7. "time"
  8. )
  9. type ChartInfoDetailResp struct {
  10. ChartInfo *chart_info.ChartInfoView
  11. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingList
  12. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  13. XDataList []XData `description:"商品价格曲线的X轴数据"`
  14. YDataList []YData `description:"柱方图的y轴数据"`
  15. MyChartInfo *responseModel.MyChartItem
  16. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  17. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  18. }
  19. type ChartLibChartInfoDetailResp struct {
  20. ChartInfo *chart_info.ChartInfoView
  21. EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingTimeString
  22. XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
  23. XDataList []XData `description:"商品价格曲线的X轴数据"`
  24. YDataList []YData `description:"柱方图的y轴数据"`
  25. CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
  26. DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
  27. WaterMark string `description:"水印"`
  28. }
  29. // XData 商品价格曲线的的x轴数据
  30. type XData struct {
  31. Name string `description:"别名"`
  32. NameEn string `description:"英文别名"`
  33. IsHide int `description:"是否隐藏,0不隐藏,1隐藏"`
  34. }
  35. // YData 柱方图的y轴数据
  36. type YData struct {
  37. Date string `description:"数据日期"`
  38. ConfigDate time.Time `description:"配置的日期" json:"-"`
  39. Color string `description:"数据颜色"`
  40. Name string `description:"别名"`
  41. NameEn string `description:"英文别名"`
  42. Value []float64 `description:"每个指标的值"`
  43. NoDataEdbList []int `description:"没有数据的指标列表"`
  44. XEdbInfoIdList []int `description:"对应X轴的指标id列表"`
  45. EdbValMap map[int]float64 `description:"指标与值的对应" json:"-"`
  46. M []int `description:"对应开始日期的间隔值" json:"-"`
  47. NameList []string `description:"每个值对应的名称"`
  48. EnNameList []string `description:"每个值对应的英文名称"`
  49. SeriesEdb struct {
  50. SeriesId int `description:"因子指标系列ID"`
  51. EdbInfoId int `description:"指标ID"`
  52. } `description:"对应的系列指标"`
  53. }
  54. type CorrelationInfo struct {
  55. LeadValue int `description:"领先值"`
  56. LeadUnit string `description:"领先单位"`
  57. StartDate string `description:"开始日期"`
  58. EndDate string `description:"结束日期"`
  59. EdbInfoIdFirst int `description:"A指标ID"`
  60. EdbInfoIdSecond int `description:"B指标ID"`
  61. PeriodData string `description:"X轴-期数数据"`
  62. CorrelationData string `description:"Y轴-相关性系数"`
  63. AnalysisMode int `description:"分析模式: 0-单因子; 1-多因子"`
  64. }
  65. // RollingCorrelationChartDataResp 滚动相关性图
  66. type RollingCorrelationChartDataResp struct {
  67. XDateTimeValue []string `description:"滚动相关性图的x轴数据,日期数据"`
  68. YDataList []YData `description:"滚动相关性图的y轴数据"`
  69. }
  70. // ProfitFutureGoodChartResp 商品利润图
  71. type ProfitFutureGoodChartResp struct {
  72. XDataList []XData
  73. YDataList []YData
  74. ProfitName string `description:"利润的名称"`
  75. ProfitNameEn string `description:"利润的英文名称"`
  76. Extra request.ChartInfoReq `description:"柱方图的配置"`
  77. }
  78. // RadarChartInfoResp 雷达图数据
  79. type RadarChartInfoResp struct {
  80. YDataList []RadarYData `description:"数据列"`
  81. XEdbIdValue []int
  82. }
  83. // RadarYData 雷达图的y轴数据
  84. type RadarYData struct {
  85. Date string `description:"数据日期"`
  86. Color string `description:"数据颜色"`
  87. Name string `description:"别名"`
  88. Value []float64 `description:"每个指标的值"`
  89. }