Why labels and gridlines doesn't display

Thread is closed for posting
3 posts, 1 answers
  1. Ales Ruzicka
    Ales Ruzicka avatar
    2 posts
    Member since:
    Oct 2009

    Posted 07 Jan 2010 Link to this post

    In provided source code those things doesn't work and I don't understand why.

    <MajorGridLines Visible="true" PenStyle="Dot" Width="1" /> should cause gridline to display, but it doesn't. Unless I set With more than 1 (2 works fine). But I need gridline of with 1.

    <TextBlock Text="TestX"should cause label to be displayed on the side. But it doesn't again. I don't get why.

    Whole source:

    <telerik:RadChart runat="server" ID="rchTest" Skin="Office2007" AutoLayout="true"
          <ChartTitle> 
          <TextBlock Visible="false" /> 
        </ChartTitle> 
        <Legend> 
          <Appearance Position-AlignedPosition="Bottom"
          </Appearance>       
        </Legend> 
        <PlotArea> 
          <Appearance> 
            <Border Width="0" /> 
          </Appearance> 
            <XAxis LayoutMode="Inside" MinValue="1" Step="1">         
              <AxisLabel> 
                <TextBlock Text="TestX"
                  <Appearance Position-AlignedPosition="Left" />             
                </TextBlock> 
              </AxisLabel> 
              <Appearance ValueFormat="General"
                <MajorGridLines Visible="true" PenStyle="Dot" Width="1" /> 
                <MinorGridLines Visible="false" />             
              </Appearance>           
            </XAxis> 
            <YAxis AutoScale="false"
              <AxisLabel> 
                <TextBlock Text="TestY"
                  <Appearance Position-AlignedPosition="Left" />             
                </TextBlock> 
              </AxisLabel> 
              <Appearance ValueFormat="General"
                <MajorGridLines Visible="true" Width="1" /> 
                <MinorGridLines Visible="false" />                       
              </Appearance>           
              <Items> 
                <telerik:ChartAxisItem TextBlock-Text="" Value="0" /> 
                <telerik:ChartAxisItem TextBlock-Text="L1" Value="1" /> 
                <telerik:ChartAxisItem TextBlock-Text="L2" Value="2" /> 
                <telerik:ChartAxisItem TextBlock-Text="L3" Value="3" /> 
                <telerik:ChartAxisItem TextBlock-Text="L4" Value="4" /> 
                <telerik:ChartAxisItem TextBlock-Text="L5" Value="5" /> 
              </Items> 
            </YAxis> 
        </PlotArea> 
        <Series> 
            <telerik:ChartSeries Name="Series 1" Type="Line"
                <Appearance ShowLabels="false"
                    <FillStyle MainColor="Red"
                    </FillStyle> 
                </Appearance> 
                <Items> 
                    <telerik:ChartSeriesItem YValue="1" Name="Item 1"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="2" Name="Item 2"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="1" Name="Item 3"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="3" Name="Item 4"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="2" Name="Item 5"
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
            <telerik:ChartSeries Name="Series 2" Type="Line"
                <Appearance ShowLabels="false"
                    <FillStyle MainColor="Blue"
                    </FillStyle> 
                </Appearance> 
                <Items> 
                    <telerik:ChartSeriesItem YValue="3" Name="Item 1"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="1" Name="Item 2"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="5" Name="Item 3"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="1" Name="Item 4"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="2" Name="Item 5"
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
        </Series> 
      </telerik:RadChart> 

  2. Answer
    Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 07 Jan 2010 Link to this post

    I tested your code and the grid lines display fine. One thing to note is that the axis labels are not visible by default, so you have to specifically say that you want to display them. The following code rendered the image attached:

    ASPX:
    <telerik:RadChart runat="server" ID="RadChart1" Skin="Office2007" AutoLayout="true">  
          <ChartTitle>  
          <TextBlock Visible="false" />  
        </ChartTitle>  
        <Legend>  
          <Appearance Position-AlignedPosition="Bottom">  
          </Appearance>        
        </Legend>  
        <PlotArea>  
          <Appearance>  
            <Border Width="0" />  
          </Appearance>  
            <XAxis LayoutMode="Inside" MinValue="1" Step="1">          
              <AxisLabel Visible="true">  
                <TextBlock Text="TestX">  
                  <Appearance Position-AlignedPosition="Left" />              
                </TextBlock>  
              </AxisLabel>  
              <Appearance ValueFormat="General">  
                <MajorGridLines Visible="true" PenStyle="Dot" Width="1" />  
                <MinorGridLines Visible="false" />              
              </Appearance>            
            </XAxis>  
            <YAxis AutoScale="false">  
              <AxisLabel Visible="True">  
                <TextBlock Text="TestY">  
                  <Appearance Position-AlignedPosition="Left" />              
                </TextBlock>  
              </AxisLabel>  
              <Appearance ValueFormat="General">  
                <MajorGridLines Visible="true" Width="1" />  
                <MinorGridLines Visible="false" />                        
              </Appearance>            
              <Items>  
                <telerik:ChartAxisItem TextBlock-Text="" Value="0" />  
                <telerik:ChartAxisItem TextBlock-Text="L1" Value="1" />  
                <telerik:ChartAxisItem TextBlock-Text="L2" Value="2" />  
                <telerik:ChartAxisItem TextBlock-Text="L3" Value="3" />  
                <telerik:ChartAxisItem TextBlock-Text="L4" Value="4" />  
                <telerik:ChartAxisItem TextBlock-Text="L5" Value="5" />  
              </Items>  
            </YAxis>  
        </PlotArea>  
        <Series>  
            <telerik:ChartSeries Name="Series 1" Type="Line">  
                <Appearance ShowLabels="false">  
                    <FillStyle MainColor="Red">  
                    </FillStyle>  
                </Appearance>  
                <Items>  
                    <telerik:ChartSeriesItem YValue="1" Name="Item 1">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="2" Name="Item 2">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="1" Name="Item 3">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="3" Name="Item 4">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="2" Name="Item 5">  
                    </telerik:ChartSeriesItem>  
                </Items>  
            </telerik:ChartSeries>  
            <telerik:ChartSeries Name="Series 2" Type="Line">  
                <Appearance ShowLabels="false">  
                    <FillStyle MainColor="Blue">  
                    </FillStyle>  
                </Appearance>  
                <Items>  
                    <telerik:ChartSeriesItem YValue="3" Name="Item 1">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="1" Name="Item 2">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="5" Name="Item 3">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="1" Name="Item 4">  
                    </telerik:ChartSeriesItem>  
                    <telerik:ChartSeriesItem YValue="2" Name="Item 5">  
                    </telerik:ChartSeriesItem>  
                </Items>  
            </telerik:ChartSeries>  
        </Series>  
      </telerik:RadChart>  

    Notice that I only set Visible="True" on the axis labels.


  3. Ales Ruzicka
    Ales Ruzicka avatar
    2 posts
    Member since:
    Oct 2009

    Posted 07 Jan 2010 Link to this post

    I found out that about visibility and I found out that Width at MajorGridLines is float rather than int I expected, so it wors fine with 1.1 and still looks fine.
    So i consider this closed. Thank you.
Back to Top