Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #108966
    salasidis
    Participant

    I am trying to create a band on eth value axis, but can’t seem to get a combination that works

     

    This is what I have, and I am getting errors

     

    List<ChartSeriesGroup> seriesGroups = new List<ChartSeriesGroup>(){
    new ChartSeriesGroup()
    {

    Type = ChartType.Line,
    ValueAxis = new ChartValueAxis()
    {
    //UnitInterval = 10,
    //MinValue = 0,
    //MaxValue = 100,

    AxisSize = “auto”,
    Description = “Val”
    },

    Bands = new List<ChartValueAxisBand>()
    {
    new ChartValueAxisBand()
    {
    Opacity = 0.05,
    MinValue = 10,
    MaxValue = 20
    }
    },
    Series = new List<ChartSeriesGroupSerie>()
    {
    new ChartSeriesGroupSerie()
    {
    DataField = “”,
    DisplayText = “”,

    }
    }
    }

    #108971

    Hi,

    Here is an example of using colour bands in Blazor:
    https://www.htmlelements.com/blazor/blazor-ui/demos/blazor-chart?id=color-bands

    I can see that you haven’t set DataField for your ChartSeriesGroupSerie also.

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

    #108972
    salasidis
    Participant

    The example did not have any bands in it, is it possible to repost. Thanks

     

    I programmatically set the DisplayField and TextField elsewhere, and tried to set the Band values there as well (but the latter part did not work – likely because the actual elements were not properly created by me)

     

    chart is defined as

    <Chart @ref=”lineChart” DataSource=”chartData” Animation=”Animation.None” Caption=”” Description=””
    ShowLegend=”false” ShowBorderLine=”false” Padding=”new Padding() { Left = 5, Top = 15, Right = 25, Bottom = 5 }”
    XAxis=”xAxis” SeriesGroups=”seriesGroups” ColorScheme=”ChartColorScheme.Scheme01″ OnReady=”OnChartReady” @key=”updateChart” showToolTips=”true” />

     

     

    some elements are altered

    chartData = EWparData;

    seriesGroups.ElementAt(0).Series.ElementAt(0).DataField = “Result”;
    seriesGroups.ElementAt(0).Series.ElementAt(0).DisplayText = par;

    seriesGroups.ElementAt(0).ValueAxis.Description = par;
    seriesGroups.ElementAt(0).ValueAxis.Bands.ElementAt(0).Opacity = (float)0.05;
    seriesGroups.ElementAt(0).ValueAxis.Bands.ElementAt(0).MinValue = (float)minN;
    seriesGroups.ElementAt(0).ValueAxis.Bands.ElementAt(0).MaxValue = (float)maxN;

    dispChart = true;

     

     

    #108973
    salasidis
    Participant

    I changed the Bands definition to ChartSeriesGroupBand (instead of ChartValueAxisBand)

    Bands = new List<ChartSeriesGroupBand>()
    {
    new ChartSeriesGroupBand()
    {
    Opacity = (float)0.05,
    MinValue = 10,
    MaxValue = 20
    }
    },

     

    The setting of the data is

    seriesGroups.ElementAt(0).Bands.ElementAt(0).Opacity = (float)0.05;
    seriesGroups.ElementAt(0).Bands.ElementAt(0).MinValue = (float)minN;
    seriesGroups.ElementAt(0).Bands.ElementAt(0).MaxValue = (float)maxN;

     

    This compiles successfully, but I get no visible bands

     

    #109008

    Hi,

    May you navigate to demos from the link I have sent you and then select the demo ‘Color Bands’
    You can see that there are color bands, try to implement them as in the demo.

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.