1

Visifire XAMLの円グラフの凡例の垂直スクロールビューアのスクロールビューアスタイルを変更する方法はありますか?

これが私のコードです:

<visifire:Chart x:Name="EmployeeMasterFileChart" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0" Background="{x:Null}" Margin="0,0,0,0" Padding="4,0,4,4" MaxWidth="500">
                        <visifire:Chart.PlotArea>
                            <visifire:PlotArea Background="Transparent" />
                        </visifire:Chart.PlotArea>
                        <visifire:Chart.Legends>
                            <visifire:Legend x:Name="Legend0" HorizontalAlignment="Left" VerticalAlignment="Center" EntryMargin="5"
                            Padding="10" FontSize="10" FontWeight="Normal" ShadowEnabled="False" BorderThickness="0" Background="Transparent" LightingEnabled="False"/>
                        </visifire:Chart.Legends>

                        <visifire:Chart.Titles>
                            <visifire:Title FontSize="12" Text="Title" Margin="0,10,0,0" />
                        </visifire:Chart.Titles>

                        <visifire:Chart.Series>

                            <visifire:DataSeries RenderAs="Pie" LabelEnabled="false" Bevel="True" ShadowEnabled="true" Cursor="Hand" 
                                LightingEnabled="False" BorderColor="DarkBlue" 
                                BorderThickness=".24" ShowInLegend="True" IncludePercentageInLegend="True">

                                <visifire:DataSeries.DataPoints> 
                                    <visifire:DataPoint AxisXLabel="Jan" YValue="5509"/> 
                                    <visifire:DataPoint AxisXLabel="Feb" YValue="2047"/> 
                                    <visifire:DataPoint AxisXLabel="Mar" YValue="10047"/> 
                                    <visifire:DataPoint AxisXLabel="Apr" YValue="8508"/> 
                                    <visifire:DataPoint AxisXLabel="May" YValue="6022"/> 
                                    <visifire:DataPoint AxisXLabel="Jun" YValue="9047"/> 
                                    <visifire:DataPoint AxisXLabel="Jul" YValue="7508"/> 
                                    <visifire:DataPoint AxisXLabel="Aug" YValue="5222"/> 
                                    <visifire:DataPoint AxisXLabel="Sep" YValue="3698"/> 
                                    <visifire:DataPoint AxisXLabel="Oct" YValue="5754"/> 
                                    <visifire:DataPoint AxisXLabel="Nov" YValue="8756"/> 
                                    <visifire:DataPoint AxisXLabel="Dec" YValue="2340"/> 
                                    <visifire:DataPoint AxisXLabel="Jan" YValue="5509"/> 
                                    <visifire:DataPoint AxisXLabel="Feb" YValue="2047"/> 
                                    <visifire:DataPoint AxisXLabel="Mar" YValue="10047"/> 
                                    <visifire:DataPoint AxisXLabel="Apr" YValue="8508"/> 
                                    <visifire:DataPoint AxisXLabel="May" YValue="6022"/> 
                                    <visifire:DataPoint AxisXLabel="Jun" YValue="9047"/> 
                                    <visifire:DataPoint AxisXLabel="Jul" YValue="7508"/> 
                                    <visifire:DataPoint AxisXLabel="Aug" YValue="5222"/> 
                                    <visifire:DataPoint AxisXLabel="Sep" YValue="3698"/> 
                                    <visifire:DataPoint AxisXLabel="Oct" YValue="5754"/> 
                                    <visifire:DataPoint AxisXLabel="Nov" YValue="8756"/> 
                                    <visifire:DataPoint AxisXLabel="Dec" YValue="2340"/> 
                                </visifire:DataSeries.DataPoints> 

                            </visifire:DataSeries>
                        </visifire:Chart.Series>
                    </visifire:Chart>
4

1 に答える 1

3

凡例の縦スクロール ビューアの ScrollBar スタイルを変更したいのでしょう。

現在、Legend の Vertical ScrollViewer にある垂直 ScrollBar の Style を設定する直接的なオプションはありません。ただし、以下の回避策を試すことができます。

Chart のスコープの下にある ScrollBar のグローバル スタイルを作成するだけです。ScrollBar の Template プロパティを設定し、必要に応じて変更します。以下の例をご覧ください。

ここに画像の説明を入力

XAML

 <vc:Chart Height="300" Width="500">
            <vc:Chart.Resources>
                <Style TargetType="ScrollBar">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ScrollBar">
                             ..................
                             ......Here you need to edit Template of the ScrollBar....
                             ..................
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

            </vc:Chart.Resources>
            <vc:Chart.Titles>
                <vc:Title FontSize="12" Text="Title" Margin="0,10,0,0" />
            </vc:Chart.Titles>
            <vc:Chart.Legends>
                <vc:Legend HorizontalAlignment="Left"  VerticalAlignment="Center"></vc:Legend>
            </vc:Chart.Legends>

            <vc:Chart.Series>

                <vc:DataSeries RenderAs="Pie" LabelEnabled="false" Bevel="True" ShadowEnabled="true" Cursor="Hand" 
                    LightingEnabled="False" BorderColor="DarkBlue" 
                    BorderThickness=".24" ShowInLegend="True" IncludePercentageInLegend="True">

                    <vc:DataSeries.DataPoints>
                        <vc:DataPoint AxisXLabel="Jan" YValue="5509"/>
                        <vc:DataPoint AxisXLabel="Feb" YValue="2047"/>
                        <vc:DataPoint AxisXLabel="Mar" YValue="10047"/>
                        <vc:DataPoint AxisXLabel="Apr" YValue="8508"/>
                        <vc:DataPoint AxisXLabel="May" YValue="6022"/>
                        <vc:DataPoint AxisXLabel="Jun" YValue="9047"/>
                        <vc:DataPoint AxisXLabel="Jul" YValue="7508"/>
                        <vc:DataPoint AxisXLabel="Aug" YValue="5222"/>
                        <vc:DataPoint AxisXLabel="Sep" YValue="3698"/>
                        <vc:DataPoint AxisXLabel="Oct" YValue="5754"/>
                        <vc:DataPoint AxisXLabel="Nov" YValue="8756"/>
                        <vc:DataPoint AxisXLabel="Dec" YValue="2340"/>
                        <vc:DataPoint AxisXLabel="Jan" YValue="5509"/>
                        <vc:DataPoint AxisXLabel="Feb" YValue="2047"/>
                        <vc:DataPoint AxisXLabel="Mar" YValue="10047"/>
                        <vc:DataPoint AxisXLabel="Apr" YValue="8508"/>
                        <vc:DataPoint AxisXLabel="May" YValue="6022"/>
                        <vc:DataPoint AxisXLabel="Jun" YValue="9047"/>
                        <vc:DataPoint AxisXLabel="Jul" YValue="7508"/>
                        <vc:DataPoint AxisXLabel="Aug" YValue="5222"/>
                        <vc:DataPoint AxisXLabel="Sep" YValue="3698"/>
                        <vc:DataPoint AxisXLabel="Oct" YValue="5754"/>
                        <vc:DataPoint AxisXLabel="Nov" YValue="8756"/>
                        <vc:DataPoint AxisXLabel="Dec" YValue="2340"/>
                    </vc:DataSeries.DataPoints>

                </vc:DataSeries>
            </vc:Chart.Series>
        </vc:Chart>

以下のリンクからsetting-scrollbar-style-in-legend-workarround.zipファイルをダウンロードできます。

https://skydrive.live.com/?cid=61995e3895be1728&sc=documents&id=61995E3895BE1728%21125#

于 2011-09-15T11:52:13.070 に答える