It doesn't seem to work below is my MVC Code:
Ext.Net.Chart chtGrafico = new Ext.Net.Chart()
{
ID = "SnapShotChart",
Animate = true,
Height = 300,
Shadow = true,
};
var store = CreateStore(isMonteCarlo);
store.DataSource = result;
chtGrafico.Store.Add(store);
if (isMonteCarlo)
{
NumericAxis numericAxis = new NumericAxis()
{
Fields = new[] { "MeanEstimatedPrice", "MaxEstimatedPrice", "MinEstimatedPrice" },
Grid = true,
Title = "Price per UOM",
Minimum = 0.00,
Label = l
};
chtGrafico.Axes.Add(numericAxis);
}
//Creating ColumnSeries
if (isMonteCarlo)
{
absSeries.Add(
Html.X().ColumnSeries()
.Axis(Position.Left)
.XField("CountryName")
.YField("MeanEstimatedPrice")
.Highlight(true)
.Tips(Html.X().ChartTip()
.TrackMouse(true)
.Width(380)
.Height(28)
.Renderer(r => r.Handler = "this.setTitle(storeItem.get('CountryName')+',Price:'+ storeItem.get('PACK_CURRENCY_DESC') + ' ' + storeItem.get('MeanEstimatedPrice'));")
)
.Label(new SeriesLabel()
{
Display = SeriesLabelDisplay.None,
Field = new[] { "MeanEstimatedPrice" },
Orientation = Orientation.Horizontal,
Color = "#333E",
TextAnchor = "middle"
})
.Renderer(r => r.Handler = @"
var c= new Array();
var colorsArr =['green'] ;
attributes.fill = colorsArr[index % colorsArr.length];
return attributes;")
);
//Max
absSeries.Add(
Html.X().ColumnSeries()
.Axis(Position.Left)
.XField("CountryName")
.YField("MaxEstimatedPrice")
.Highlight(true)
.Tips(Html.X().ChartTip()
.TrackMouse(true)
.Width(380)
.Height(28)
.Renderer(r => r.Handler = "this.setTitle(storeItem.get('CountryName')+',Price:'+ storeItem.get('PACK_CURRENCY_DESC') + ' ' + storeItem.get('MaxEstimatedPrice'));")
)
.Label(new SeriesLabel()
{
Display = SeriesLabelDisplay.None,
Field = new[] { "MaxEstimatedPrice" },
Orientation = Orientation.Horizontal,
Color = "#333E",
TextAnchor = "middle"
})
.Renderer(r => r.Handler = @"
var c= new Array();
var colorsArr =['blue'] ;
attributes.fill = colorsArr[index % colorsArr.length];
return attributes;")
);
//Min
absSeries.Add(
Html.X().ColumnSeries()
.Axis(Position.Left)
.XField("CountryName")
.YField("MinEstimatedPrice")
.Highlight(true)
.Tips(Html.X().ChartTip()
.TrackMouse(true)
.Width(380)
.Height(28)
.Renderer(r => r.Handler = "this.setTitle(storeItem.get('CountryName')+',Price:'+ storeItem.get('PACK_CURRENCY_DESC') + ' ' + storeItem.get('MinEstimatedPrice'));")
)
.Label(new SeriesLabel()
{
Display = SeriesLabelDisplay.None,
Field = new[] { "MinEstimatedPrice" },
Orientation = Orientation.Horizontal,
Color = "#333E",
TextAnchor = "middle"
})
.Renderer(r => r.Handler = @"
var c= new Array();
var colorsArr =['red'] ;
attributes.fill = colorsArr[index % colorsArr.length];
return attributes;")
);
}
I only get the column for Mean i.e. green color as attached:
Note: In my case right now the values for "Mean,Max and Min" are same to 111.
I think the 3 bars are overlapping.
But that might not be the case for every scenario