我有一个 Shield UI 条形图,我想从图表本身未显示的数据中获得一个值。在此示例中,我希望能够访问“strTest”的数据值。
var dataHours = new List<HoursType>()
{
//This month
new HoursType() { Billable = Math.Round(billThisMonth / totalThisMonth * 100, 2), NonBillable = Math.Round(nonBillThisMonth / totalThisMonth * 100, 2), strTest = nonBillThisMonth},
//Last month
new HoursType() { Billable = Math.Round(billLastMonth / totalLastMonth * 100, 2), NonBillable = Math.Round(nonBillLastMonth / totalLastMonth * 100, 2), strTest = nonBillLastMonth},
//YTD
new HoursType() { Billable = Math.Round(billYTD / totalYTD * 100, 2), NonBillable = Math.Round(nonBillYTD / totalYTD * 100, 2), strTest = nonBillYTD}
};
chtBillableNonBillable.DataSource = dataHours;
chtBillableNonBillable.DataBind();
这是asp前端。我尝试在“CustomPointText”属性中使用 point.strTest,但它没有获取数据。
<shield:ShieldChart ID="chtBillableNonBillable" Width="100%" Height="400px" runat="server" CssClass="chart">
<PrimaryHeader Text="Billable/Non-Billable Hours"></PrimaryHeader>
<TooltipSettings CustomPointText="{point.strTest} / {point.y}" >
</TooltipSettings>
<ExportOptions AllowExportToImage="true" AllowPrint="true" />
<Axes>
<shield:ChartAxisX CategoricalValues="Current Month, Last Month, YTD"></shield:ChartAxisX>
<shield:ChartAxisY>
<Title Text="% of Hours"></Title>
</shield:ChartAxisY>
</Axes>
<DataSeries>
<shield:ChartBarSeries DataFieldY="Billable" CollectionAlias="Billable Hours" >
</shield:ChartBarSeries>
<shield:ChartBarSeries DataFieldY="NonBillable" CollectionAlias="Non-Billable Hours">
</shield:ChartBarSeries>
</DataSeries>
</shield:ShieldChart>
任何帮助,将不胜感激。谢谢!