blurred text on the radchart

Thread is closed for posting
2 posts, 0 answers
  1. prayag ganoje
    prayag ganoje avatar
    127 posts
    Member since:
    Feb 2010

    Posted 04 May 2011 Link to this post

    Hello,

    I am using the latest version of controls. Observed that the text on the chart is blured. These charts are placed in radDock controls.

    Is there any compression effect which makes the text blur ?
    What could be the reason and how to fix this issue ?

    Code used to create the chart at runtime:
    Protected Sub loadChart(ByVal dtStartDate As String, ByVal dtEndDate As String)
            Dim objReportEditChart As New Toolkit.Report
            objReportEditChart = getReport("CSMD_Average_Response_Time")
      
            Try
                Dim ds As New DataSet
                Dim da = New SqlDataAdapter(objReportEditChart._Query + "'" + dtStartDate + "', '" + dtEndDate + "')", strDSN)
                da.Fill(ds)
      
                rc_CSMD_Average_Response_Time.RemoveAllSeries()
      
                Dim sr_Days As New ChartSeries("Days", ChartSeriesType.Bar)
                rc_CSMD_Average_Response_Time.Series.Add(sr_Days)
      
                list.Clear()
                list.Add("HH:MM")
                Dim dr As DataRow() = ds.Tables(0).[Select]("severity='Severity 1'")
                If dr.Count > 0 Then
                    sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                    list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
                Else
                    sr_Days.AddItem(0)
                    list.Add("0:0")
                End If
      
                dr = ds.Tables(0).Select("severity='Severity 2'")
                If dr.Count > 0 Then
                    sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                    list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
                Else
                    sr_Days.AddItem(0)
                    list.Add("0:0")
                End If
      
                dr = ds.Tables(0).Select("severity='Severity 3'")
                If dr.Count > 0 Then
                    sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                    list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
                Else
                    sr_Days.AddItem(0)
                    list.Add("0:0")
                End If
      
                dr = ds.Tables(0).Select("severity='Severity 4'")
                If dr.Count > 0 Then
                    sr_Days.AddItem(Convert.ToDecimal(dr(0).ItemArray(2).ToString()))
                    list.Add(dr(0).ItemArray(0).ToString() + ":" + dr(0).ItemArray(1).ToString())
                Else
                    sr_Days.AddItem(0)
                    list.Add("0:0")
                End If
      
                'Dim barColors As Color() = New Color() {Color.Yellow, Color.Red, Color.Yellow, Color.Green, Color.SteelBlue}
                Dim barColors As String() = New String() {"#FFFFFF", "#7F0000", "#FFDD59", "#267F00", "#005999"}
                Dim i As Integer = 0
                For Each item As ChartSeriesItem In rc_CSMD_Average_Response_Time.Series(0).Items
                    item.Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(barColors(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))) ''barColors(System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1))
                    item.Appearance.FillStyle.FillType = Styles.FillType.Solid
                Next
      
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.Visible = True
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.PenStyle = Drawing2D.DashStyle.Dash
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.MajorGridLines.Color = Color.DarkGray
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.Visible = True
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.PenStyle = Drawing2D.DashStyle.Dash
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.MajorGridLines.Color = Color.DarkGray
                rc_CSMD_Average_Response_Time.PlotArea.Appearance.Border.Visible = False
                rc_CSMD_Average_Response_Time.Appearance.Border.Visible = False
                rc_CSMD_Average_Response_Time.Height = System.Web.UI.WebControls.Unit.Pixel(255)
                rc_CSMD_Average_Response_Time.Width = System.Web.UI.WebControls.Unit.Pixel(255)
                rc_CSMD_Average_Response_Time.Appearance.Border.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
                rc_CSMD_Average_Response_Time.SeriesOrientation = ChartSeriesOrientation.Vertical
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
      
                Dim t1 As Telerik.Charting.ChartXAxis = rc_CSMD_Average_Response_Time.PlotArea.XAxis
                t1.Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
                t1.AxisLabel.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
                t1.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
                Dim t2 As Telerik.Charting.ChartYAxis = rc_CSMD_Average_Response_Time.PlotArea.YAxis
                t2.Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
                t2.AxisLabel.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
                t2.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
      
                rc_CSMD_Average_Response_Time.Series(0).Appearance.TextAppearance.TextProperties.Font = New System.Drawing.Font("Verdana", 7.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1, False)
                rc_CSMD_Average_Response_Time.Series(0).Appearance.TextAppearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
                rc_CSMD_Average_Response_Time.Series(0).Appearance.Border.Color = System.Drawing.ColorTranslator.FromHtml("#4C4C4C")
                rc_CSMD_Average_Response_Time.Series(0).Appearance.Border.Width = 1
      
                'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.Visible = True
                'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.Appearance.Position.AlignedPosition = Styles.AlignedPositions.BottomRight
                'rc_CSMD_Average_Response_Time.PlotArea.XAxis.AxisLabel.TextBlock.Text = "SEVERITY"
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.Visible = True
                'rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.Appearance.Position.AlignedPosition = Styles.AlignedPositions.TopLeft
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisLabel.TextBlock.Text = "DAYS"
      
                rc_CSMD_Average_Response_Time.AutoLayout = True
                rc_CSMD_Average_Response_Time.IntelligentLabelsEnabled = True
                rc_CSMD_Average_Response_Time.ChartTitle.Visible = False
                rc_CSMD_Average_Response_Time.Legend.Visible = False
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.AutoScale = False
                rc_CSMD_Average_Response_Time.Skin = "Vista"
                rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.MainColor = Color.White
                rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.SecondColor = Color.White
                rc_CSMD_Average_Response_Time.PlotArea.Appearance.FillStyle.FillType = Styles.FillType.Gradient
                rc_CSMD_Average_Response_Time.Appearance.FillStyle.MainColor = Color.White
                rc_CSMD_Average_Response_Time.Appearance.FillStyle.SecondColor = Color.White
                rc_CSMD_Average_Response_Time.Appearance.FillStyle.FillType = Styles.FillType.Gradient
                rc_CSMD_Average_Response_Time.PlotArea.YAxis.AxisMode = ChartYAxisMode.Extended
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.Clear()
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 1")
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 2")
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 3")
                rc_CSMD_Average_Response_Time.PlotArea.XAxis.AddItem("SEV 4")
      
                arrHeader(0) = "SEV"
                arrHeader(1) = "SEV1"
                arrHeader(2) = "SEV2"
                arrHeader(3) = "SEV3"
                arrHeader(4) = "SEV4"
                arrData(0) = list(0).ToString()
                arrData(1) = list(1).ToString()
                arrData(2) = list(2).ToString()
                arrData(3) = list(3).ToString()
                arrData(4) = list(4).ToString()
      
            Catch ex As SqlException
                Console.WriteLine("SQL exception occurred: " & ex.Message)
            End Try
        End Sub
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 09 May 2011 Link to this post

    Hello,
    In this case, I would recommend that you try the different values of the TextQuality property and choose the one that provides a result that is closest to the one you expect. For example:
    <telerik:RadChart runat="server" ID="Test">
        <Appearance TextQuality="ClearTypeGridFit">
        </Appearance>

    You can additionally increase the readability of the labels, by changing some of the styles that you have applied to them. For example, you can use black as color, instead of grey, etc.

    Regards,
    Tsvetie
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top