Skip to content

Commit

Permalink
fix of the data type mis-matched error
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Dec 20, 2024
1 parent e67805a commit 618c9ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ggplot/Internal/ggplot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,10 @@ Public Class ggplot : Inherits Plot
End Sub

Private Sub DrawMultiple(all As IggplotLegendElement(), g As IGraphics, canvas As GraphicsRegion, pos As PointF)
Dim width As Double = canvas.Padding.Right / (all.Length + 1)
Dim css As CSSEnvirnment = g.LoadEnvironment
Dim box As Rectangle = canvas.PlotRegion(css)
Dim padding As PaddingLayout = PaddingLayout.EvaluateFromCSS(CSS, canvas.Padding)
Dim width As Double = padding.Right / (all.Length + 1)
Dim box As Rectangle = canvas.PlotRegion(CSS)
Dim x As Double
Dim y As Double

Expand Down
3 changes: 2 additions & 1 deletion src/ggplot/Internal/layers/ggplotLayer.vb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Namespace layers
Dim padding As New GraphicsRegion(g.Size, theme.padding)
Dim legend As ColorMapLegend
Dim css As CSSEnvirnment = g.LoadEnvironment
Dim margin As PaddingLayout = PaddingLayout.EvaluateFromCSS(css, theme.padding)

If TypeOf colorMap Is ggplotColorPalette Then
legend = New ColorMapLegend(DirectCast(palette.colorMap, String), maplevels)
Expand All @@ -161,7 +162,7 @@ Namespace layers

legends = New legendColorMapElement With {
.colorMapLegend = legend,
.width = padding.Padding.Right * 3 / 4,
.width = margin.Right * 3 / 4,
.height = padding.PlotRegion(css).Height
}

Expand Down
3 changes: 2 additions & 1 deletion src/ggplot/Internal/layers/scatter/ggplotTileLayer.vb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Namespace layers
Dim textures As Brush() = colors.Select(Function(c) c.GetBrush).ToArray
Dim rxi, ryi As Double
Dim css As CSSEnvirnment = stream.g.LoadEnvironment
Dim padding As PaddingLayout = PaddingLayout.EvaluateFromCSS(css, stream.canvas.Padding)

For i As Integer = 0 To x.Length - 1
rxi = stream.scale.TranslateX(x(i)) - tile_size.Width
Expand All @@ -158,7 +159,7 @@ Namespace layers
.ticks = fillData.CreateAxisTicks,
.titleFont = css.GetFont(stream.theme.legendTitleCSS)
},
.width = stream.canvas.Padding.Right * 3 / 4,
.width = padding.Right * 3 / 4,
.height = stream.canvas.PlotRegion(css).Height
}
End Function
Expand Down

0 comments on commit 618c9ee

Please sign in to comment.