.net char コントロールを使用してチャート グラフィックを作成しています。私の問題は、白または透明な背景を使用しないと、値ラベルと軸ラベルが常に太字になることです!
.ChartAreas(0).AxisY.LabelStyle.Font = New Drawing.Font("Arial", 8.0F, FontStyle.Regular)
フォントを通常に設定しましたが、白い背景では通常のフォントとしてしか表示されません。背景を白からグレーに変えています。灰色のフォントは常に太字です。
助言がありますか?
Dim myChart As New Chart
With myChart
.Width = 685 + 130
.Height = 45 + letzteZusatz * 2
.RenderType = RenderType.ImageTag
.AntiAliasing = AntiAliasingStyles.All
.TextAntiAliasingQuality = TextAntiAliasingQuality.High
If white Then
.BackColor = Color.FromArgb(100, 252, 252, 252)
white = False
Else
.BackColor = Color.FromArgb(100, 220, 220, 220)
white = True
End If
.ChartAreas.Add("ChartArea1")
.ChartAreas("ChartArea1").Area3DStyle.Enable3D = False
With .ChartAreas(0)
.BackColor = Color.Transparent
.BorderWidth = 0
.AxisX.LineWidth = 0
.AxisY.LineWidth = CType((0 + (letzteZusatz * 0.1)), Integer)
.AxisY.LineColor = Color.FromArgb(100, 194, 195, 192)
.AxisY.Minimum = minimum
.AxisY.Maximum = CType(maximum * 1.1, Integer)
.AxisX.LabelStyle.Enabled = False
.AxisY.LabelStyle.Enabled = True
.AxisY.LabelStyle.Angle = 0
.AxisY.LabelStyle.Format = "N0"
.AxisY.LabelStyle.Font = New Drawing.Font("Arial", 8.0F, FontStyle.Regular)
.AxisY.IsLabelAutoFit = False
.AxisY.LabelAutoFitStyle = LabelAutoFitStyles.None
.AxisX.MajorGrid.Enabled = False
.AxisY.MajorGrid.Enabled = True
.IsSameFontSizeForAllAxes = True
.AxisY.MajorGrid.LineColor = Color.FromArgb(100, 194, 195, 192)
.AxisY.MajorTickMark.Enabled = True
.AxisY.MinorTickMark.Enabled = False
.AxisX.MajorTickMark.Enabled = False
.AxisX.MinorTickMark.Enabled = False
.AxisY.MajorTickMark.LineColor = Color.FromArgb(100, 194, 195, 192)
.BorderWidth = 0
.AlignmentOrientation = AreaAlignmentOrientations.Vertical
.InnerPlotPosition = New ElementPosition(16, 0, 84, CType((100 - (letzteZusatz * 3)), Single))
End With
.DataBindTable(BuildChartTabel(o, seite), "Name")
For Each s As Series In myChart.Series
s.ChartType = SeriesChartType.Bar
s.BorderWidth = 0
s.MarkerSize = 0
s.IsValueShownAsLabel = True
s("PixelPointWidth") = "45"
For Each p As DataPoint In s.Points
p.BackImage = "~/img/bg_chart.png"
p.BackImageWrapMode = ChartImageWrapMode.Tile
p.BorderWidth = 0
p.MarkerSize = 0
Next
Next
End With
Using chartimage = New FileStream("D:\test.png", FileMode.Create)
myChart.SaveImage(chartimage, ChartImageFormat.Png)
chartimage.Flush()
End Using