沒錯,我玩過一段時間,很好的挖掘SDK,有點谷歌,這是我能想到的最好的。
我知道如何將文字放置在圖表上的任意位置,但只能使用靜態文本,例如,我不知道如何動態地將文本綁定到任何東西 - 我懷疑這與CRM比CRM更重要,我無法找到CRM和圖表的很多文檔。
所以我發現TextAnnotation可以讓你隨心所欲地放置文本。這包含在Annotations
集合中。
例如:
<Chart>
...
<Annotations>
<TextAnnotation Text="This is an annotation" Name="TextAnnotation1" X="20" Y="50">
</TextAnnotation>
</Annotations>
...
</Chart>
注意所以重要的是,TextAnnotation
的位置是相對的,例如註釋將出現左側圖表寬度的20%。 0,0是左上角。 MSDN在positioning上有更多的細節。
這樣我就可以創建一個圖表是這樣的:
![enter image description here](https://i.stack.imgur.com/qMHhM.png)
HELLO WORLD!是註釋。
使用此XML:
<Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83">
<Series>
<Series ShadowOffset="0" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="pie">
<SmartLabelStyle Enabled="True" />
</Series>
</Series>
<ChartAreas>
<ChartArea>
<Area3DStyle Enable3D="false" />
</ChartArea>
</ChartAreas>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
</Legends>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
</Titles>
<Annotations>
<TextAnnotation Text="HELLO WORLD!" Font="Stencil, 15.75pt, style=Bold, Italic, GdiCharSet=0" Name="TextAnnotation1" X="20" Y="50" ForeColor="Orange">
</TextAnnotation>
</Annotations>
</Chart>
如果那不達到你的要求,我建議有一個看一個SSRS報告或iFrame的入儀表板的一些其他定製件。
您目前如何構建報告? –
@JamesWood請看我的編輯。 –
我已經盡力做到了,如承諾的那樣。但我失敗了。不是說沒有辦法。只是說這不是非常普遍的要求,也不適用於任何人。這可以通過IFRAME完成,並且/或者像一個外部資源? – 2012-11-11 11:07:57