Compare commits
2 Commits
09d0676e08
...
142c3b1d10
| Author | SHA1 | Date | |
|---|---|---|---|
| 142c3b1d10 | |||
| 566acb5c91 |
@ -58,4 +58,12 @@
|
||||
DefaultLabels
|
||||
End Enum
|
||||
|
||||
Public Enum DesignTypeEnum
|
||||
DefaultColors
|
||||
Mixed
|
||||
Office2013
|
||||
Aspect
|
||||
Solstice
|
||||
End Enum
|
||||
|
||||
End Namespace
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
Public Class ChartParameter
|
||||
Public Id As Integer
|
||||
Public Title As String
|
||||
Public SerieTitle As String
|
||||
Public ChartPos As Constants.ChartPosEnum
|
||||
Public SQLCommand As String
|
||||
Public ChartType As Constants.ChartTypeEnum
|
||||
@ -8,6 +9,8 @@
|
||||
Public Value As String
|
||||
Public SearchId As Integer
|
||||
Public LabelType As Constants.LabelTypeEnum
|
||||
Public DesignType As Constants.DesignTypeEnum
|
||||
Public DesignBaseColor As Integer
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Title
|
||||
|
||||
@ -24,6 +24,8 @@ Imports DevExpress.XtraEditors
|
||||
Imports System.Drawing.Imaging
|
||||
Imports System.IO
|
||||
Imports DevExpress.XtraBars
|
||||
Imports System.Net
|
||||
Imports System.Runtime.InteropServices.ComTypes
|
||||
|
||||
|
||||
Public Class frmMonitor
|
||||
@ -324,6 +326,7 @@ Public Class frmMonitor
|
||||
End Select
|
||||
|
||||
SetChartTitle(ChartViewResults, oChartParameterSet.Title)
|
||||
SetChartDesign(ChartViewResults, oChartParameterSet.DesignType, oChartParameterSet.DesignBaseColor)
|
||||
Dim oSerie As Series = Await GetChartSerie(oChartParameterSet, oControls)
|
||||
ChartViewResults.Series.Add(oSerie)
|
||||
Next
|
||||
@ -417,6 +420,24 @@ Public Class frmMonitor
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub SetChartDesign(pChartView As ChartControl, pDesignType As DesignTypeEnum, pDesignBaseColor As Integer)
|
||||
|
||||
Select Case pDesignType
|
||||
Case DesignTypeEnum.Aspect
|
||||
pChartView.PaletteName = "Aspect"
|
||||
Case DesignTypeEnum.Mixed
|
||||
pChartView.PaletteName = "Mixed"
|
||||
Case DesignTypeEnum.Office2013
|
||||
pChartView.PaletteName = "Office 2013"
|
||||
Case DesignTypeEnum.Solstice
|
||||
pChartView.PaletteName = "Solstice"
|
||||
Case Else
|
||||
pChartView.PaletteName = "Office"
|
||||
End Select
|
||||
|
||||
pChartView.PaletteBaseColorNumber = pDesignBaseColor
|
||||
End Sub
|
||||
|
||||
Private Sub ActivateMenuBarButtons(pSearchType As ReturnTypeEnum)
|
||||
Select Case pSearchType
|
||||
Case ReturnTypeEnum.ChartView
|
||||
@ -433,19 +454,27 @@ Public Class frmMonitor
|
||||
Private Async Function GetChartSerie(pChartParameters As ChartParameter, pControls As List(Of Control)) As Threading.Tasks.Task(Of Series)
|
||||
Dim oSerie As Series
|
||||
|
||||
Dim serieTitle As String
|
||||
|
||||
If String.IsNullOrEmpty(pChartParameters.SerieTitle) = False Then
|
||||
serieTitle = pChartParameters.SerieTitle
|
||||
Else
|
||||
serieTitle = pChartParameters.Title
|
||||
End If
|
||||
|
||||
Select Case pChartParameters.ChartType
|
||||
Case ChartTypeEnum.Bar
|
||||
oSerie = New Series(pChartParameters.Title, ViewType.Bar)
|
||||
oSerie = New Series(serieTitle, ViewType.Bar)
|
||||
Case ChartTypeEnum.Line
|
||||
oSerie = New Series(pChartParameters.Title, ViewType.Line)
|
||||
oSerie = New Series(serieTitle, ViewType.Line)
|
||||
Case ChartTypeEnum.Area
|
||||
oSerie = New Series(pChartParameters.Title, ViewType.Area)
|
||||
oSerie = New Series(serieTitle, ViewType.Area)
|
||||
Case ChartTypeEnum.Pie
|
||||
oSerie = New Series(pChartParameters.Title, ViewType.Pie) With {
|
||||
oSerie = New Series(serieTitle, ViewType.Pie) With {
|
||||
.LegendTextPattern = "{A}"
|
||||
}
|
||||
Case ChartTypeEnum.StackedBar
|
||||
oSerie = New Series(pChartParameters.Title, ViewType.StackedBar)
|
||||
oSerie = New Series(serieTitle, ViewType.StackedBar)
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
|
||||
@ -107,7 +107,10 @@ Public Class SearchLoader
|
||||
.ChartType = GetChartType(oRow.ItemEx("CHART_TYPE", String.Empty)),
|
||||
.Argument = oRow.ItemEx("ARGUMENT", String.Empty),
|
||||
.Value = oRow.ItemEx("VALUE", String.Empty),
|
||||
.LabelType = GetLabelType(oRow.ItemEx("LABEL_TYPE", String.Empty))
|
||||
.LabelType = GetLabelType(oRow.ItemEx("LABEL_TYPE", String.Empty)),
|
||||
.SerieTitle = oRow.ItemEx("SERIE_TITLE", String.Empty),
|
||||
.DesignType = GetDesignType(oRow.ItemEx("DESIGN_TYPE", String.Empty)),
|
||||
.DesignBaseColor = GetDesignBaseColor(oRow.ItemEx("DESIGN_TYPE", String.Empty))
|
||||
})
|
||||
Next
|
||||
|
||||
@ -181,6 +184,37 @@ Public Class SearchLoader
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetDesignType(pTypeString As String) As DesignTypeEnum
|
||||
|
||||
Dim items() As String = pTypeString.Split("|"c)
|
||||
|
||||
Select Case items(0).ToUpper
|
||||
Case "ASPECT"
|
||||
Return DesignTypeEnum.Aspect
|
||||
Case "MIXED"
|
||||
Return DesignTypeEnum.Mixed
|
||||
Case "OFFICE2013"
|
||||
Return DesignTypeEnum.Office2013
|
||||
Case "SOLSTICE"
|
||||
Return DesignTypeEnum.Solstice
|
||||
Case Else
|
||||
Return DesignTypeEnum.DefaultColors
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetDesignBaseColor(pTypeString As String) As Integer
|
||||
Dim items() As String = pTypeString.Split("|"c)
|
||||
Dim retValue As Integer = 0
|
||||
|
||||
If items.Length > 1 Then
|
||||
If Integer.TryParse(items(1), retValue) = False Then
|
||||
retValue = 0
|
||||
End If
|
||||
End If
|
||||
|
||||
Return retValue
|
||||
End Function
|
||||
|
||||
Private Function GetChartPosType(pPosTypeId As Integer) As ChartPosEnum
|
||||
Select Case pPosTypeId
|
||||
Case 1
|
||||
|
||||
@ -11,7 +11,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("Monitor")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("1.6.4.0")>
|
||||
<Assembly: AssemblyTrademark("1.6.5.0")>
|
||||
<Assembly: AssemblyCulture("")>
|
||||
|
||||
' Setting ComVisible to false makes the types in this assembly not visible
|
||||
@ -32,5 +32,5 @@ Imports System.Runtime.InteropServices
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
' [assembly: AssemblyVersion("1.0.*")]
|
||||
<Assembly: AssemblyVersion("1.6.3.0")>
|
||||
<Assembly: AssemblyVersion("1.6.5.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user