XYDiagram3D.BarDistanceFixed Property
Gets or sets the fixed distance value (in pixels) between two bars of different 3D Bar Series shown at the same argument point.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v24.2.dll
NuGet Package: DevExpress.Wpf.Charts
Declaration
Property Value
Type | Description |
---|---|
Int32 | An integer value that represents the distance between two neighboring bars, in pixels. |
Remarks
The BarDistanceFixed property is introduced by the XYDiagram3D class, to synchronize it in all 3D Side-by-Side Bar series which are present in a chart.
The BarDistanceFixed property specifies the distance between two bars in a 3D Side-by-Side Bar series. This property’s value is measured in pixels, thus allowing the distance set to remain the same when the size of a chart is changed.
To specify the distance between two bars as a fraction of axis units, use the XYDiagram3D.BarDistance property. If both the BarDistanceFixed and XYDiagram3D.BarDistance properties are in effect at the same time, their values are combined together as constant and variable distances.
Example
This example demonstrates how to create a 3D Manhattan Bar chart.
Create a ChartControl and specify its ChartControl.Diagram property to a XYDiagram3D object.
Note
Note that the ChartControl.Diagram is a content property. You can declare a diagram in XAML directly after a chart control’s declaration and not wrap it in opening and closing ChartControl.Diagram tags.
Add a BarSeries3D object to the Diagram.Series collection.
Note
Note that the Diagram.Series is a content property. You can declare series in XAML directly after a diagram’s declaration and not wrap it in opening and closing Diagram.Series tags.
Use the following properties to bind the series to data:
- Series.DataSource - Specifies the series’s data source.
- Series.ArgumentDataMember - Defines the data member that provides the series’s arguments.
- Series.ValueDataMember - Specifies the data member that provides the series’s values.
<Window x:Class="ManhattanBar3DChart.Window1"
xmlns:local="clr-namespace:ManhattanBar3DChart"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
Title="Main Window" Height="492" Width="851.5">
<Grid>
<dxc:ChartControl Name="chartControl1">
<dxc:ChartControl.DataContext>
<local:DevAVSalesByYear/>
</dxc:ChartControl.DataContext>
<dxc:XYDiagram3D BarDistance="0.3"
BarDistanceFixed="5"
SeriesDistance="1"
ZoomPercent="140"
HorizontalScrollPercent="-10"
VerticalScrollPercent="10">
<dxc:XYDiagram3D.ContentTransform>
<MatrixTransform3D>
<MatrixTransform3D.Matrix>
<Matrix3D M11="0.82" M12="-0.06" M13="0.575" M14="0"
M21="0.01" M22="1" M23="0.089" M24="0"
M31="-0.578" M32="-0.067" M33="0.813" M34="0"
M44="1"
OffsetZ="0" OffsetX="0" OffsetY="0"/>
</MatrixTransform3D.Matrix>
</MatrixTransform3D>
</dxc:XYDiagram3D.ContentTransform>
<dxc:BarSeries3D
x:Name="series1"
DisplayName="{Binding Series1DisplayName}"
DataSource="{Binding Series1Source}"
ArgumentDataMember="Region"
ValueDataMember="Sales"/>
<dxc:BarSeries3D
x:Name="series2"
DisplayName="{Binding Series2DisplayName}"
DataSource="{Binding Series2Source}"
ArgumentDataMember="Region"
ValueDataMember="Sales"/>
<dxc:BarSeries3D
x:Name="series3"
DisplayName="{Binding Series3DisplayName}"
DataSource="{Binding Series3Source}"
ArgumentDataMember="Region"
ValueDataMember="Sales"/>
</dxc:XYDiagram3D>
<dxc:ChartControl.Legends>
<dxc:Legend
HorizontalPosition="Right"
ReverseItems="True" />
</dxc:ChartControl.Legends>
<dxc:ChartControl.Titles>
<dxc:Title Content="DevAV Sales"
Dock="Top"
HorizontalAlignment="Center"/>
</dxc:ChartControl.Titles>
</dxc:ChartControl>
</Grid>
</Window>