Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Category group label doesnt show up on x axis
posted

Hi Team,

I am trying to bind a dynamic data table collection to graph .On X axis i am trying to display the column RopReport.Though i assign the value it is showing up for few reports for others its not.Any help would be greatly appreciated.

Xaml:







-->


<ig:NumericYAxis.TitleSettings >





ItemsSource="{Binding ListOfReportDistribution,UpdateSourceTrigger=PropertyChanged}" ValueMemberPath="DataDensityValue"
Thickness='0' MinWidth="200" Outline='Black' LegendItemVisibility="Visible" IsTransitionInEnabled="True" ToolTip="{StaticResource VariationTooltip}"
IsCustomCategoryStyleAllowed="True" AssigningCategoryStyle="ColumnSeries_AssigningCategoryStyle" >




XAxis="{Binding ElementName=XAxis}" YAxis="{Binding ElementName=YAxis}"
ItemsSource="{Binding ListOfReportDistribution,UpdateSourceTrigger=PropertyChanged}" Brush="Transparent"
DashArray="20,2" ToolTip="{StaticResource VariationTooltip}" ToolTipService.IsEnabled="True"
AssigningCategoryStyle="ColumnSeries_AssigningCategoryStyle" ValueMemberPath="NormalizedUpdateRate"
MinWidth="200" Outline='Black' LegendItemVisibility="Visible" IsTransitionInEnabled="True" >





The mentioned graph binds column ropreport for few reports for others its not(For 1st and 3rd group of reports it is showing up as 35 and 65 for others its not though the data is present in the data table.

Thanks in advance for your support

Regards,

Sridhar

  • 34810
    Offline posted in reply to Sridhar Mallapareddy

    Hello Sridhar,

    I have recently written a response to another forum thread that we have together, here that may help you on this matter: http://ko.infragistics.com/community/forums/t/108741.aspx.

    Essentially, the XamDataChart does not have functionality built in to group ColumnSeries categories. Each data item, or data table row in this case, will be a new category on the CategoryXAxis, and so you would need to place your report data in a single row in the bound data table to your CategoryXAxis in order to only have your categories of 35, 50, 65, and 80. Note, I would not expect that this data table would be the same one as is bound to the data grid in your screenshot, but a separate one, created based on the data in the data grid's data source.

    Where I think that the above mentioned forum thread may help you is in the mentioning of the idea of creating data table columns that have a target data type of a custom class of your creation. Doing this would allow you to populate the data table with your own Report objects for each RopReport numbered category. These objects would then have their own properties that you could bind to, allowing the specific, report-level properties to be kept in the data table in the form of these objects.

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

  • 34810
    Offline posted in reply to Sridhar Mallapareddy

    Hello Sridhar,

    This topic reminds me of another one that we had together, here: http://ko.infragistics.com/community/forums/t/107485.aspx.

    My interpretation of the XAML code that you have sent and the data grid that exists in your screenshot is that you are binding your XamDataChart's CategoryXAxis label to the "RopReport" column values of your data grid, and this is why you are seeing the behavior you are seeing currently. It looks like for each numbered "RopReport" in your data table, you have two or three null entries, which will count as categories as they are still data records. The XamDataChart will not group your data for you, and these null entries will be drawn as new categories in the chart, which is likely why you are seeing the label offset that you are. You also seem to have quite a few categories in this case, and it is possible that the XamDataChart isn't drawing all of them. To ensure all of them are drawn, you can set the CategoryXAxis' Interval property to 1.

    In order to truly group your data in this case, you will need to have a single data record for each numeric "RopReport" in the bound DataTable to the XamDataChart. For instance, looking at the old forum thread I had linked above, you would need to do something along the lines of having a data table in which your column structure could be along the lines of RopReport, Report1Value, Report2Value, Report3Value, etc. The number of "ReportValue" properties in this case would correspond to the highest number of reports in a single "RopReport" value. Looking at your current data, this number appears to be 3, as you have 3 records per "RopReport" value. Doing this will only draw category labels for the corresponding category "RopReport" column, and so, in the case of your current data source, you would have a DataTable with a 4 rows inside. The "RopReport" value for these rows would be 35, 50, 65, and 80 and when plotted, you would only see those labels drawn onto the axis of your chart.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

  • 115
    posted

    Forgot to attach the xaml for the issue.Here is it.

    The mentioned xaml has label column that which is not getting properly binded to the graph.

    Label="{}{RopReport}" 

    <ig:XamDataChart x:Name="Chart" Margin="2,2,0,-200" Grid.Row="1" >
    <ig:XamDataChart.Axes>
    <ig:CategoryXAxis x:Name="XAxis" ItemsSource="{Binding ListOfReportDistribution,UpdateSourceTrigger=PropertyChanged}" Label="{}{RopReport}" Title="Reports" Overlap="1" >
    <!--Label="{}{ReportName}"-->
    <!--<ig:CategoryXAxis.LabelSettings >
    <ig:AxisLabelSettings Angle="-60" VerticalAlignment="Center" TextAlignment="Justify" />
    </ig:CategoryXAxis.LabelSettings>-->
    </ig:CategoryXAxis>
    <ig:NumericYAxis x:Name="YAxis" MinimumValue="0" MajorStrokeThickness="0" MinorStrokeThickness="0" Title="Data Density (pts/ft)" >
    <ig:NumericYAxis.TitleSettings >
    <ig:TitleSettings Angle="-90" Position="Auto" />
    </ig:NumericYAxis.TitleSettings>
    </ig:NumericYAxis>
    </ig:XamDataChart.Axes>
    <ig:XamDataChart.Series>
    <ig:ColumnSeries Name="DensitySeries" Margin="0,0,0,0" ShowDefaultTooltip="True" HorizontalAlignment="Stretch" XAxis="{Binding ElementName=XAxis}" YAxis="{Binding ElementName=YAxis}"
    ItemsSource="{Binding ListOfReportDistribution,UpdateSourceTrigger=PropertyChanged}" ValueMemberPath="DataDensityValue"
    Thickness='0' MinWidth="200" Outline='Black' LegendItemVisibility="Visible" IsTransitionInEnabled="True" ToolTip="{StaticResource VariationTooltip}"
    IsCustomCategoryStyleAllowed="True" AssigningCategoryStyle="ColumnSeries_AssigningCategoryStyle" >
    <ig:ColumnSeries.LegendItemBadgeTemplate>
    <DataTemplate>
    </DataTemplate>
    </ig:ColumnSeries.LegendItemBadgeTemplate>

    </ig:ColumnSeries>
    <ig:ColumnSeries Name="DensityVariationSeries" ShowDefaultTooltip="True" HorizontalAlignment="Stretch"
    XAxis="{Binding ElementName=XAxis}" YAxis="{Binding ElementName=YAxis}"
    ItemsSource="{Binding ListOfReportDistribution,UpdateSourceTrigger=PropertyChanged}" Brush="Transparent"
    DashArray="20,2" ToolTip="{StaticResource VariationTooltip}" ToolTipService.IsEnabled="True"
    AssigningCategoryStyle="ColumnSeries_AssigningCategoryStyle" ValueMemberPath="NormalizedUpdateRate"
    MinWidth="200" Outline='Black' LegendItemVisibility="Visible" IsTransitionInEnabled="True" >
    <ig:ColumnSeries.LegendItemBadgeTemplate>
    <DataTemplate>
    </DataTemplate>
    </ig:ColumnSeries.LegendItemBadgeTemplate>
    </ig:ColumnSeries>
    </ig:XamDataChart.Series>
    </ig:XamDataChart>

    Regards.

    Sridhar.