Blazor 軸オプション
すべての Ignite UI for Blazor チャートで、軸はタイトル、ラベル、範囲などの視覚的構成のプロパティを提供します。これらの機能は、以下の例で示されています。
Blazor WebAssembly および Blazor Server 向けに最適化された 60 以上の高性能チャートを使用 とグラフを使用して、生データを魅力的な視覚化に変換し、最高の UX を実現します。
軸タイトルの例
Blazor チャートの軸タイトル機能を使用すると、チャートにコンテキスト情報を追加できます。さまざまなフォントスタイル、色、マージン、および配置を適用するなど、さまざまな方法で軸タイトルの外観をカスタマイズできます。
using System;
using System.Collections.Generic;
public class CountryRenewableElectricityItem
{
public string Year { get; set; }
public double Europe { get; set; }
public double China { get; set; }
public double America { get; set; }
}
public class CountryRenewableElectricity
: List<CountryRenewableElectricityItem>
{
public CountryRenewableElectricity()
{
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2009",
Europe = 34,
China = 21,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2010",
Europe = 43,
China = 26,
America = 24
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2011",
Europe = 66,
China = 29,
America = 28
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2012",
Europe = 69,
China = 32,
America = 26
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2013",
Europe = 58,
China = 47,
America = 38
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2014",
Europe = 40,
China = 46,
America = 31
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2015",
Europe = 78,
China = 50,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2016",
Europe = 13,
China = 90,
America = 52
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2017",
Europe = 78,
China = 132,
America = 50
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2019",
Europe = 80,
China = 96,
America = 38
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbLegendModule),
typeof(IgbCategoryChartModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="legend-title">
Renewable Electricity Generated
</div>
<div class="legend">
<IgbLegend
Name="legend"
@ref="legend"
Orientation="LegendOrientation.Horizontal">
</IgbLegend>
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="CountryRenewableElectricity"
IncludedProperties="@(new string[] { "Year", "Europe", "China", "America" })"
ChartType="CategoryChartType.Line"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
ComputedPlotAreaMarginMode="ComputedPlotAreaMarginMode.Series"
XAxisTitle="Year"
XAxisTitleTextColor="gray"
XAxisTitleTextStyle="10pt 'Titillium Web'"
XAxisTitleAngle="0"
YAxisTitle="Trillions of Watt-hours (Twh)"
YAxisTitleTextColor="gray"
YAxisTitleTextStyle="10pt 'Titillium Web'"
YAxisTitleAngle="90"
YAxisTitleLeftMargin="5">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var legend = this.legend;
var chart = this.chart;
this.BindElements = () => {
chart.Legend = this.legend;
};
this.BindElements();
}
private IgbLegend legend;
private IgbCategoryChart chart;
private CountryRenewableElectricity _countryRenewableElectricity = null;
public CountryRenewableElectricity CountryRenewableElectricity
{
get
{
if (_countryRenewableElectricity == null)
{
_countryRenewableElectricity = new CountryRenewableElectricity();
}
return _countryRenewableElectricity;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
このサンプルが気に入りましたか? 完全な Ignite UI for Blazorツールキットにアクセスして、すばやく独自のアプリの作成を開始します。無料でダウンロードできます。
軸ラベルの例
Blazor チャートは、チャートで表示されるラベルの構成、書式設定、およびラベル フォントのスタイル設定を制御することが可能です。軸ラベルの回転角度、マージン、水平および垂直方向の配置、色、余白、および表示設定を変更できます。次の例は、これらの軸の機能を使用する方法を示しています。
using System;
using System.Collections.Generic;
public class CountryRenewableElectricityItem
{
public string Year { get; set; }
public double Europe { get; set; }
public double China { get; set; }
public double America { get; set; }
}
public class CountryRenewableElectricity
: List<CountryRenewableElectricityItem>
{
public CountryRenewableElectricity()
{
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2009",
Europe = 34,
China = 21,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2010",
Europe = 43,
China = 26,
America = 24
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2011",
Europe = 66,
China = 29,
America = 28
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2012",
Europe = 69,
China = 32,
America = 26
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2013",
Europe = 58,
China = 47,
America = 38
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2014",
Europe = 40,
China = 46,
America = 31
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2015",
Europe = 78,
China = 50,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2016",
Europe = 13,
China = 90,
America = 52
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2017",
Europe = 78,
China = 132,
America = 50
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2019",
Europe = 80,
China = 96,
America = 38
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbPropertyEditorPanelModule),
typeof(IgbLegendModule),
typeof(IgbCategoryChartModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="options vertical">
<IgbPropertyEditorPanel
DescriptionType="CategoryChart"
IsHorizontal="true"
IsWrappingEnabled="true"
Name="propertyEditorPanel1"
@ref="propertyEditorPanel1">
<IgbPropertyEditorPropertyDescription
PropertyPath="XAxisLabelAngle"
Name="XAxisLabelAngleEditor"
@ref="xAxisLabelAngleEditor"
Label="X Axis Label Angle"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.EnumValue"
DropDownNames="@(new string[] { "0", "45", "90", "135", "180", "225", "270" })"
DropDownValues="@(new string[] { "0", "45", "90", "135", "180", "225", "270" })"
PrimitiveValue="0">
</IgbPropertyEditorPropertyDescription>
<IgbPropertyEditorPropertyDescription
PropertyPath="YAxisLabelAngle"
Name="YAxisLabelAngleEditor"
@ref="yAxisLabelAngleEditor"
Label="Y Axis Label Angle"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.EnumValue"
DropDownNames="@(new string[] { "-90", "-45", "0", "45", "90" })"
DropDownValues="@(new string[] { "-90", "-45", "0", "45", "90" })"
PrimitiveValue="0">
</IgbPropertyEditorPropertyDescription>
<IgbPropertyEditorPropertyDescription
PropertyPath="XAxisLabelTextColor"
Name="XAxisLabelTextColorEditor"
@ref="xAxisLabelTextColorEditor"
Label="Y Axis Label Color"
ValueType="PropertyEditorValueType.EnumValue"
ShouldOverrideDefaultEditor="true"
DropDownNames="@(new string[] { "red", "green" })"
DropDownValues="@(new string[] { "red", "green" })"
PrimitiveValue="@("red")">
</IgbPropertyEditorPropertyDescription>
</IgbPropertyEditorPanel>
</div>
<div class="legend-title">
Renewable Electricity Generated
</div>
<div class="legend">
<IgbLegend
Name="legend"
@ref="legend"
Orientation="LegendOrientation.Horizontal">
</IgbLegend>
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="CountryRenewableElectricity"
IncludedProperties="@(new string[] { "Year", "Europe", "China", "America" })"
ChartType="CategoryChartType.Line"
ComputedPlotAreaMarginMode="ComputedPlotAreaMarginMode.Series"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
TopMargin="20"
XAxisLabelAngle="0"
XAxisLabelTextColor="gray"
XAxisLabelTextStyle="10pt 'Titillium Web'"
XAxisLabelTopMargin="5"
YAxisLabelAngle="0"
YAxisLabelTextColor="gray"
YAxisLabelTextStyle="10pt 'Titillium Web'"
YAxisLabelRightMargin="5"
YAxisLabelLocation="YAxisLabelLocation.OutsideRight"
TitleTopMargin="10">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var legend = this.legend;
var propertyEditorPanel1 = this.propertyEditorPanel1;
var xAxisLabelAngleEditor = this.xAxisLabelAngleEditor;
var yAxisLabelAngleEditor = this.yAxisLabelAngleEditor;
var xAxisLabelTextColorEditor = this.xAxisLabelTextColorEditor;
var chart = this.chart;
this.BindElements = () => {
propertyEditorPanel1.Target = this.chart;
chart.Legend = this.legend;
};
this.BindElements();
}
private IgbLegend legend;
private IgbPropertyEditorPanel propertyEditorPanel1;
private IgbPropertyEditorPropertyDescription xAxisLabelAngleEditor;
private IgbPropertyEditorPropertyDescription yAxisLabelAngleEditor;
private IgbPropertyEditorPropertyDescription xAxisLabelTextColorEditor;
private IgbCategoryChart chart;
private CountryRenewableElectricity _countryRenewableElectricity = null;
public CountryRenewableElectricity CountryRenewableElectricity
{
get
{
if (_countryRenewableElectricity == null)
{
_countryRenewableElectricity = new CountryRenewableElectricity();
}
return _countryRenewableElectricity;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
軸ラベルの管理と書式設定
チャートの軸には、所有する軸のラベルに使用可能なスペースの量に関する拡張計算を実行する機能があります。この拡張された計算により、軸は、指定された軸に対してより多くのラベルを表示するために、指定されたスペースの量を最適化できます。
この拡張された計算は、オプトインする必要があるものです。これは、UseEnhancedIntervalManagement
プロパティを true に設定することで実行できます。次に、軸の Interval
プロパティを手動で設定せずに、軸のディメンションに収まるだけの数のラベルを表示したい場合は、軸の EnhancedIntervalPreferMoreCategoryLabels
プロパティを true に設定できます。
チャートには、ラベルが割り当てられたスペースに収まらない場合にラベルの自動回転を考慮する機能と、ラベルが収まるようにプロット領域に自動マージンを適用する機能もあります。これは、最初にチャートの AutoMarginAndAngleUpdateMode
プロパティを SizeChanging
または SizeChangingAndZoom
に設定することで最初にオプトインできるものです。これにより、必要に応じて、ラベルに適用された自動マージンと角度をいつ再評価するかがチャートに通知されます。
AutoMarginAndAngleUpdateMode
を設定した後、ShouldAutoExpandMarginForInitialLabels
プロパティを true に設定して自動マージンをオプトインするか ShouldConsiderAutoRotationForInitialLabels
プロパティを true に設定して自動回転を行うことができます。AutoExpandMarginExtraPadding
と AutoExpandMarginMaximumValue
を設して、それぞれ追加のスペースまたは可能な最大マージンを提供することにより、適用される自動マージンをさらにカスタマイズすることもできます。
IgbNumberFormatSpecifier
や IgbDateTimeFormatSpecifier
などのカスタム ラベル書式は、XAxisLabelFormatSpecifier
および YAxisLabelFormatSpecifier
コレクションを介して各軸に追加できます。一般に、Intl.NumberFormat および Intl.DateTimeFormat の言語に依存した数値、日付、時刻の書式設定を適用するために使用されます。ラベルにカスタム書式を適用するには、YAxisLabelFormat
または XAxisLabelFormat
を IgbCategoryChart
のデータ項目のプロパティ名 (例: {Date}
) に設定する必要があります。IgbFinancialChart
の場合、数値軸を使用するため、数値がコンテキストとなり、これを {0}
に設定する必要があります。
次の例では、yAxis を IgbNumberFormatSpecifier
でフォーマットして、米国のトップ興行収入映画の $USD 価格を表します。
using System;
using System.Collections.Generic;
public class HighestGrossingMoviesItem
{
public string Franchise { get; set; }
public double TotalRevenue { get; set; }
public double HighestGrossing { get; set; }
}
public class HighestGrossingMovies
: List<HighestGrossingMoviesItem>
{
public HighestGrossingMovies()
{
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Marvel Universe",
TotalRevenue = 22.55,
HighestGrossing = 2.8
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Star Wars",
TotalRevenue = 10.32,
HighestGrossing = 2.07
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Harry Potter",
TotalRevenue = 9.19,
HighestGrossing = 1.34
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Avengers",
TotalRevenue = 7.76,
HighestGrossing = 2.8
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Spider Man",
TotalRevenue = 7.22,
HighestGrossing = 1.28
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"James Bond",
TotalRevenue = 7.12,
HighestGrossing = 1.11
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbPropertyEditorPanelModule),
typeof(IgbDataLegendModule),
typeof(IgbCategoryChartModule),
typeof(IgbNumberFormatSpecifierModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="legend-title">
Highest Grossing Movie Franchises
</div>
<div class="legend">
<IgbDataLegend
Name="legend"
@ref="legend"
ValueFormatString="{0} Billion"
ValueFormatSpecifiers="NumberFormatSpecifier1">
</IgbDataLegend>
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="HighestGrossingMovies"
ChartType="CategoryChartType.Column"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
FinalValueAnnotationsPrecision="2"
DataToolTipValueFormatString="{0} Billion"
DataToolTipValueFormatSpecifiers="NumberFormatSpecifier3"
YAxisLabelFormat="{0}B"
YAxisLabelFormatSpecifiers="NumberFormatSpecifier5">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var legend = this.legend;
var chart = this.chart;
this.BindElements = () => {
legend.Target = this.chart;
};
this.BindElements();
}
private IgbDataLegend legend;
private IgbNumberFormatSpecifier[] _numberFormatSpecifier1 = null;
public IgbNumberFormatSpecifier[] NumberFormatSpecifier1
{
get
{
if (this._numberFormatSpecifier1 == null)
{
var numberFormatSpecifier1 = new IgbNumberFormatSpecifier[1];
var numberFormatSpecifier2 = new IgbNumberFormatSpecifier();
numberFormatSpecifier2.Style = "currency";
numberFormatSpecifier2.Currency = "USD";
numberFormatSpecifier2.CurrencyDisplay = "symbol";
numberFormatSpecifier2.MaximumFractionDigits = 2;
numberFormatSpecifier2.MinimumFractionDigits = 2;
numberFormatSpecifier1[0] = numberFormatSpecifier2;
this._numberFormatSpecifier1 = numberFormatSpecifier1;
}
return this._numberFormatSpecifier1;
}
}
private IgbCategoryChart chart;
private IgbNumberFormatSpecifier[] _numberFormatSpecifier3 = null;
public IgbNumberFormatSpecifier[] NumberFormatSpecifier3
{
get
{
if (this._numberFormatSpecifier3 == null)
{
var numberFormatSpecifier3 = new IgbNumberFormatSpecifier[1];
var numberFormatSpecifier4 = new IgbNumberFormatSpecifier();
numberFormatSpecifier4.Style = "currency";
numberFormatSpecifier4.Currency = "USD";
numberFormatSpecifier4.CurrencyDisplay = "symbol";
numberFormatSpecifier4.MaximumFractionDigits = 2;
numberFormatSpecifier4.MinimumFractionDigits = 2;
numberFormatSpecifier3[0] = numberFormatSpecifier4;
this._numberFormatSpecifier3 = numberFormatSpecifier3;
}
return this._numberFormatSpecifier3;
}
}
private IgbNumberFormatSpecifier[] _numberFormatSpecifier5 = null;
public IgbNumberFormatSpecifier[] NumberFormatSpecifier5
{
get
{
if (this._numberFormatSpecifier5 == null)
{
var numberFormatSpecifier5 = new IgbNumberFormatSpecifier[1];
var numberFormatSpecifier6 = new IgbNumberFormatSpecifier();
numberFormatSpecifier6.Style = "currency";
numberFormatSpecifier6.Currency = "USD";
numberFormatSpecifier6.CurrencyDisplay = "symbol";
numberFormatSpecifier6.MinimumFractionDigits = 0;
numberFormatSpecifier5[0] = numberFormatSpecifier6;
this._numberFormatSpecifier5 = numberFormatSpecifier5;
}
return this._numberFormatSpecifier5;
}
}
private HighestGrossingMovies _highestGrossingMovies = null;
public HighestGrossingMovies HighestGrossingMovies
{
get
{
if (_highestGrossingMovies == null)
{
_highestGrossingMovies = new HighestGrossingMovies();
}
return _highestGrossingMovies;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
軸範囲の例
チャートでは数値軸または時間軸の範囲の最小値と最大値を定義できます。範囲の最小値は軸の最小値で、範囲の最大値は軸の最大値です。これらは、YAxisMinimumValue
および YAxisMaximumValue
オプションを設定することによって設定されます。
既定では、Blazor チャートは、データ内の対応する最小値と最大値に基づいて、数値と時間軸の範囲の最小値と最大値を計算しますが、この自動計算は、データセットには適していません。たとえば、データの最小値が 850 の場合、YAxisMinimumValue
を 800 に設定してください。これにより、軸の最小値とデータ ポイントの最小値の間に 50 のスペース値ができます。YAxisMaximumValue
プロパティを使用して、同じ方法を軸の最小値と最大値に適用することができます。
using System;
using System.Collections.Generic;
public class CountryRenewableElectricityItem
{
public string Year { get; set; }
public double Europe { get; set; }
public double China { get; set; }
public double America { get; set; }
}
public class CountryRenewableElectricity
: List<CountryRenewableElectricityItem>
{
public CountryRenewableElectricity()
{
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2009",
Europe = 34,
China = 21,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2010",
Europe = 43,
China = 26,
America = 24
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2011",
Europe = 66,
China = 29,
America = 28
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2012",
Europe = 69,
China = 32,
America = 26
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2013",
Europe = 58,
China = 47,
America = 38
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2014",
Europe = 40,
China = 46,
America = 31
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2015",
Europe = 78,
China = 50,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2016",
Europe = 13,
China = 90,
America = 52
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2017",
Europe = 78,
China = 132,
America = 50
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2019",
Europe = 80,
China = 96,
America = 38
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbPropertyEditorPanelModule),
typeof(IgbLegendModule),
typeof(IgbCategoryChartModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
@using IgniteUI.Blazor.Controls
@using System
@using System.Linq
<div class="container vertical">
<div class="options vertical">
<IgbPropertyEditorPanel
DescriptionType="CategoryChart"
IsHorizontal="true"
IsWrappingEnabled="true"
Name="propertyEditorPanel1"
@ref="propertyEditorPanel1">
<IgbPropertyEditorPropertyDescription
PropertyPath="YAxisMinimumValueHandler"
Name="YAxisMinimumValue"
@ref="yAxisMinimumValue"
Label="Y Axis Minimum Value"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.EnumValue"
DropDownNames="@(new string[] { "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" })"
DropDownValues="@(new string[] { "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" })"
PrimitiveValue="0"
Changed="EditorChangeUpdateYAxisMinimumValue">
</IgbPropertyEditorPropertyDescription>
<IgbPropertyEditorPropertyDescription
PropertyPath="YAxisMaximumValueHandler"
Name="YAxisMaximumValue"
@ref="yAxisMaximumValue"
Label="Y Axis Maximum Value"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.EnumValue"
DropDownNames="@(new string[] { "100", "110", "120", "130", "140", "150", "160", "170", "180", "190", "200" })"
DropDownValues="@(new string[] { "100", "110", "120", "130", "140", "150", "160", "170", "180", "190", "200" })"
PrimitiveValue="150"
Changed="EditorChangeUpdateYAxisMaximumValue">
</IgbPropertyEditorPropertyDescription>
</IgbPropertyEditorPanel>
</div>
<div class="legend-title">
Highest Grossing Movie Franchises
</div>
<div class="legend">
<IgbLegend
Name="legend"
@ref="legend"
Orientation="LegendOrientation.Horizontal">
</IgbLegend>
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="CountryRenewableElectricity"
IncludedProperties="@(new string[] { "Year", "Europe", "China", "America" })"
ChartType="CategoryChartType.Line"
ComputedPlotAreaMarginMode="ComputedPlotAreaMarginMode.Series"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
YAxisMinimumValue="0"
YAxisMaximumValue="150">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var legend = this.legend;
var propertyEditorPanel1 = this.propertyEditorPanel1;
var yAxisMinimumValue = this.yAxisMinimumValue;
var yAxisMaximumValue = this.yAxisMaximumValue;
var chart = this.chart;
this.BindElements = () => {
propertyEditorPanel1.Target = this.chart;
chart.Legend = this.legend;
};
this.BindElements();
}
private IgbLegend legend;
private IgbPropertyEditorPanel propertyEditorPanel1;
private IgbPropertyEditorPropertyDescription yAxisMinimumValue;
private IgbPropertyEditorPropertyDescription yAxisMaximumValue;
private IgbCategoryChart chart;
public void EditorChangeUpdateYAxisMinimumValue(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
{
var chart = this.chart;
var yAxisMinimumVal = args.NewValue;
chart.YAxisMinimumValue = Convert.ToDouble(yAxisMinimumVal);
}
public void EditorChangeUpdateYAxisMaximumValue(IgbPropertyEditorPropertyDescriptionChangedEventArgs args)
{
var chart = this.chart;
var yAxisMaximumVal = args.NewValue;
chart.YAxisMaximumValue = Convert.ToDouble(yAxisMaximumVal);
}
private CountryRenewableElectricity _countryRenewableElectricity = null;
public CountryRenewableElectricity CountryRenewableElectricity
{
get
{
if (_countryRenewableElectricity == null)
{
_countryRenewableElectricity = new CountryRenewableElectricity();
}
return _countryRenewableElectricity;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
軸モードとスケール
IgbFinancialChart
および IgbCategoryChart
コントロールでは、YAxisIsLogarithmic
プロパティが true に設定されている場合はデータを Y 軸に沿って対数スケールでプロットするか、このプロパティが false (デフォルト価値) に設定されている場合は線形スケールでプロットするかを選択できます。
YAxisLogarithmBase
プロパティを使用すると、対数スケールのベースをデフォルト値の 10 から他の整数値に変更できます。IgbFinancialChart
とコントロールを使用すると、Numeric
モードと PercentChange
モードを提供する YAxisMode
プロパティを使用して、Y 軸に沿ってデータをどのように表現するかを選択できます。Numeric
モードは正確な値でデータをプロットし、PercentChange
モードは提供された最初のデータ ポイントに対する変化率としてデータを表示します。デフォルト値は Numeric
モードです。
YAxisMode
プロパティに加えて、IgbFinancialChart
コントロールには X 軸に Time
モードと Ordinal
モードを提供する XAxisMode
プロパティがあります。Time
モードはデータのギャップを X 軸にスペースを用いて描画します。つまり、週末または休日に株取引がないことを示します。Ordinal
モードはデータがない日付領域を縮小します。デフォルト値は Ordinal
モードです。
using System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbFinancialChartModule)
);
await builder.Build().RunAsync();
}
}
}
csusing System;
using System.Collections.Generic;
using System.Linq;
namespace Infragistics.Samples
{
public class StocksUtility
{
public static int intervalDays = 1;
public static int intervalHours = 0;
public static int intervalMinutes = 0;
public static double priceStart = 200;
public static double priceRange = 1;
public static double volumeRange = 1000;
public static double volumeStart = 20000000;
public static Random rand = new Random();
public static List<StockItem> GetStocksFrom(DateTime dateEnd, int years)
{
var dateStart = dateEnd.AddYears(-years);
return GetStocksBetween(dateStart, dateEnd);
}
public static List<StockItem> GetStocksItems(int points)
{
intervalDays = 0;
intervalHours = 1;
intervalMinutes = 0;
var today = DateTime.Today;
var year = today.Year;
var dateEnd = new DateTime(year, 11, 1);
var dateStart = dateEnd.AddHours(-points);
return GetStocksBetween(dateStart, dateEnd);
}
public static List<StockItem> GetStocksBetween(DateTime dateStart, DateTime dateEnd)
{
var interval = intervalDays * 24 * 60;
interval += intervalHours * 60;
interval += intervalMinutes;
var time = dateStart.AddDays(0);
var v = volumeStart;
var o = priceStart;
var h = o + (rand.NextDouble() * priceRange);
var l = o - (rand.NextDouble() * priceRange);
var c = l + (rand.NextDouble() * (h - l));
var stock = new List<StockItem> { };
while (time < dateEnd)
{
var stockItem =
new StockItem {
Date = time, Open = o, High = h, Low = l, Close = c, Volume = v
};
stock.Add(stockItem);
o = c + ((rand.NextDouble() - 0.5) * priceRange);
if (o < 0)
{
o = Math.Abs(o) + 2;
}
h = o + (rand.NextDouble() * priceRange);
l = o - (rand.NextDouble() * priceRange);
c = l + (rand.NextDouble() * (h - l));
v = v + ((rand.NextDouble() - 0.5) * volumeRange);
if (v < 0)
{
v = Math.Abs(v) + 10000;
}
o = Math.Round(o * 100) / 100;
h = Math.Round(h * 100) / 100;
l = Math.Round(l * 100) / 100;
c = Math.Round(c * 100) / 100;
v = Math.Round(v * 100) / 100;
time = time.AddMinutes(interval);
}
//setting data intent for Series Title
// (stock as any).__dataIntents = {
// close: ["SeriesTitle/Stock Prices"]
//};
return stock;
}
public static string ToShortString(double largeValue)
{
double roundValue;
if (largeValue >= 1000000)
{
roundValue = Math.Round(largeValue / 100000) / 10;
return roundValue + "M";
}
if (largeValue >= 1000)
{
roundValue = Math.Round(largeValue / 100) / 10;
return roundValue + "K";
}
roundValue = Math.Round(largeValue);
return roundValue + "";
}
public static DateTime GetYear(DateTime date)
{
return new DateTime(date.Year);
}
public static double GetQuarter(DateTime date)
{
var month = date.Month;
double d = (month + 2) / 3;
return Math.Round(d);
}
public static StockItem GetLastItem(List<StockItem> array)
{
if (array.Count == 0)
{
return null;
}
return array.LastOrDefault();
}
public static List<StockItem> GetNewItem(List<StockItem> array, int ?interval)
{
var lastItem = GetLastItem(array);
if (interval == null)
{
interval = intervalDays * 24 * 60;
interval += intervalHours * 60;
interval += intervalMinutes;
}
var time = lastItem.Date.AddMinutes(interval.Value);
double v = lastItem.Volume;
double c = lastItem.Close;
double h;
double l;
double o = c + ((rand.NextDouble() - 0.5) * priceRange);
if (o < 0)
{
o = Math.Abs(o) + 2;
}
h = o + (rand.NextDouble() * priceRange);
l = o - (rand.NextDouble() * priceRange);
c = l + (rand.NextDouble() * (h - l));
v += ((rand.NextDouble() - 0.5) * volumeRange);
if (v < 0)
{
v = Math.Abs(v) + 10000;
}
var newValue = new List<StockItem> { new StockItem { Date = time, Open = o, High = h, Low = l, Close = c, Volume = v } };
return newValue;
}
}
public class StockItem
{
public DateTime Date { get; set; }
public double Open { get; set; }
public double High { get; set; }
public double Low { get; set; }
public double Close { get; set; }
public double Volume { get; set; }
public int Index { get; set; }
public string Info { get; set; }
public int Value { get; set; }
public StockItem Clone()
{
var copy = new StockItem();
copy.Date = this.Date;
copy.Open = this.Open;
copy.High = this.High;
copy.Low = this.Low;
copy.Close = this.Close;
copy.Volume = this.Volume;
return copy;
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="options horizontal">
<label class="options-label">X-Axis Mode: </label>
<label class="options-item">
<select @bind="@XAxisMode">
<option>@FinancialChartXAxisMode.Ordinal</option>
<option>@FinancialChartXAxisMode.Time</option>
</select>
<label class="options-label">Y-Axis Mode: </label>
<select @bind="@YAxisMode">
<option>@FinancialChartYAxisMode.Numeric</option>
<option>@FinancialChartYAxisMode.PercentChange</option>
</select>
<label class="options-label">Y-Axis IsLogarithmic:</label>
<label class="options-item">
<input type="checkbox" @onchange="OnChanged" />
</label>
</label>
</div>
<div class="container vertical">
@if (Data != null)
{
<IgbFinancialChart Width="100%"
Height="100%"
DataSource="Data"
ChartType=FinancialChartType.Candle
Thickness=2
XAxisMode="XAxisMode"
YAxisMode="YAxisMode"
YAxisIsLogarithmic=YAxisIsLogarithmic/>
}
</div>
</div>
@code {
public FinancialChartXAxisMode XAxisMode = FinancialChartXAxisMode.Ordinal;
public FinancialChartYAxisMode YAxisMode = FinancialChartYAxisMode.Numeric;
public bool YAxisIsLogarithmic = false;
List<StockItem> Data;
protected override void OnInitialized()
{
var today = DateTime.Now;
var year = today.Year;
var month = today.Month;
var dateEnd = new DateTime(year, month, 1);
var dateStart = new DateTime(year - 1, month, 1);
this.Data = StocksUtility.GetStocksBetween(dateStart, dateEnd);
}
public void OnChanged(ChangeEventArgs args)
{
YAxisIsLogarithmic = (bool)args.Value;
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
軸間隔の例
Blazor チャートの XAxisGap
プロパティは、プロットされた系列の縦棒または棒間のスペースの量を決定します。このプロパティは、0.0 から 1.0 までの数値を受け入れます。値は、シリーズ間の利用可能なピクセル数からのギャップの相対幅を表します。このプロパティを 0 に設定すると、シリーズ間にギャップがレンダリングされず、1 に設定すると最大ギャップがレンダリングされます。
Blazor チャートの XAxisMaximumGap
プロパティは、許可される最大ギャップ値を決定します。このデフォルトは 1.0 に設定されていますが、XAxisGap
の設定に応じて変更できます。
Blazor チャートの XAxisMinimumGapSize
プロパティは、可能であれば、カテゴリ間のギャップに使用する最小のピクセル数を決定します。
以下の例は、ニューヨーク市のセントラル パークの摂氏の平均最高気温を示しています。これは、XAxisGap
が最初に 1 に設定された縦棒チャートで表されているため、列の間にカテゴリ全体の幅があります。スライダーを使用すると、この例のギャップを構成して、さまざまな値の効果を確認できます。
using System;
using System.Collections.Generic;
public class CountryRenewableElectricityItem
{
public string Year { get; set; }
public double Europe { get; set; }
public double China { get; set; }
public double America { get; set; }
}
public class CountryRenewableElectricity
: List<CountryRenewableElectricityItem>
{
public CountryRenewableElectricity()
{
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2009",
Europe = 34,
China = 21,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2010",
Europe = 43,
China = 26,
America = 24
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2011",
Europe = 66,
China = 29,
America = 28
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2012",
Europe = 69,
China = 32,
America = 26
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2013",
Europe = 58,
China = 47,
America = 38
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2014",
Europe = 40,
China = 46,
America = 31
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2015",
Europe = 78,
China = 50,
America = 19
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2016",
Europe = 13,
China = 90,
America = 52
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2017",
Europe = 78,
China = 132,
America = 50
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2018",
Europe = 40,
China = 134,
America = 34
});
this.Add(new CountryRenewableElectricityItem()
{
Year = @"2019",
Europe = 80,
China = 96,
America = 38
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbPropertyEditorPanelModule),
typeof(IgbLegendModule),
typeof(IgbCategoryChartModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="options vertical">
<IgbPropertyEditorPanel
DescriptionType="CategoryChart"
IsHorizontal="true"
IsWrappingEnabled="true"
Name="propertyEditorPanel1"
@ref="propertyEditorPanel1">
<IgbPropertyEditorPropertyDescription
PropertyPath="XAxisGap"
Name="XAxisGap"
@ref="xAxisGap"
Label="X Axis - Gap"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.Slider"
PrimitiveValue="0.5"
Min="0"
Max="1.5"
Step="0.1">
</IgbPropertyEditorPropertyDescription>
<IgbPropertyEditorPropertyDescription
PropertyPath="XAxisMaximumGap"
Name="XAxisMaximumGap"
@ref="xAxisMaximumGap"
Label="Maximum Gap"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.EnumValue"
DropDownNames="@(new string[] { "1.5", "1.3", "1.0", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1", "0" })"
DropDownValues="@(new string[] { "1.5", "1.3", "1.0", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1", "0" })"
PrimitiveValue="0.5">
</IgbPropertyEditorPropertyDescription>
</IgbPropertyEditorPanel>
</div>
<div class="legend-title">
Renewable Electricity Generated
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="CountryRenewableElectricity"
IncludedProperties="@(new string[] { "Year", "Europe", "China", "America" })"
ChartType="CategoryChartType.Column"
CrosshairsSnapToData="true"
YAxisTitle="TWh"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
XAxisInterval="1"
XAxisGap="0.5"
XAxisMaximumGap="1.5">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var propertyEditorPanel1 = this.propertyEditorPanel1;
var xAxisGap = this.xAxisGap;
var xAxisMaximumGap = this.xAxisMaximumGap;
var chart = this.chart;
this.BindElements = () => {
propertyEditorPanel1.Target = this.chart;
};
this.BindElements();
}
private IgbPropertyEditorPanel propertyEditorPanel1;
private IgbPropertyEditorPropertyDescription xAxisGap;
private IgbPropertyEditorPropertyDescription xAxisMaximumGap;
private IgbCategoryChart chart;
private CountryRenewableElectricity _countryRenewableElectricity = null;
public CountryRenewableElectricity CountryRenewableElectricity
{
get
{
if (_countryRenewableElectricity == null)
{
_countryRenewableElectricity = new CountryRenewableElectricity();
}
return _countryRenewableElectricity;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
軸重複の例
Blazor チャートの XAxisOverlap
プロパティを使用すると、プロットされた系列の描画された縦棒または棒の重複を設定できます。このプロパティは、-1.0 から 1.0 までの数値を受け入れます。値は、各シリーズ専用の使用可能なピクセル数からの相対的な重なりを表します。このプロパティを負の値 (-1.0 まで) に設定すると、カテゴリが互いから離れてしまい、それらの間にギャップが生じます。逆に、このプロパティを正の値 (最大 1.0) に設定すると、カテゴリが互いに重なります。値が 1 の場合、チャートはカテゴリを互いの上に表示します。
以下の例は、フランチャイズの世界の興行収入の合計とシリーズで最も収益の高い映画を比較した、世界で最も収益の高い映画フランチャイズの比較を示しています。これは、XAxisOverlap
が最初に 1 に設定された縦棒チャートで表されており、列は完全に重なり合います。スライダーを使用すると、この例の重複を構成して、さまざまな値の効果を確認できます。
using System;
using System.Collections.Generic;
public class HighestGrossingMoviesItem
{
public string Franchise { get; set; }
public double TotalRevenue { get; set; }
public double HighestGrossing { get; set; }
}
public class HighestGrossingMovies
: List<HighestGrossingMoviesItem>
{
public HighestGrossingMovies()
{
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Marvel Universe",
TotalRevenue = 22.55,
HighestGrossing = 2.8
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Star Wars",
TotalRevenue = 10.32,
HighestGrossing = 2.07
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Harry Potter",
TotalRevenue = 9.19,
HighestGrossing = 1.34
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Avengers",
TotalRevenue = 7.76,
HighestGrossing = 2.8
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"Spider Man",
TotalRevenue = 7.22,
HighestGrossing = 1.28
});
this.Add(new HighestGrossingMoviesItem()
{
Franchise = @"James Bond",
TotalRevenue = 7.12,
HighestGrossing = 1.11
});
}
}
csusing System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IgniteUI.Blazor.Controls; // for registering Ignite UI modules
namespace Infragistics.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// registering Ignite UI modules
builder.Services.AddIgniteUIBlazor(
typeof(IgbInputModule),
typeof(IgbPropertyEditorPanelModule),
typeof(IgbLegendModule),
typeof(IgbCategoryChartModule)
);
await builder.Build().RunAsync();
}
}
}
cs
@using IgniteUI.Blazor.Controls
<div class="container vertical">
<div class="options vertical">
<IgbPropertyEditorPanel
DescriptionType="CategoryChart"
IsHorizontal="true"
IsWrappingEnabled="true"
Name="propertyEditorPanel1"
@ref="propertyEditorPanel1">
<IgbPropertyEditorPropertyDescription
PropertyPath="XAxisOverlap"
Name="XAxisOverlap"
@ref="xAxisOverlap"
Label="X Axis - Overlap"
ShouldOverrideDefaultEditor="true"
ValueType="PropertyEditorValueType.Slider"
Min="0"
Max="1"
Step="0.1"
PrimitiveValue="0">
</IgbPropertyEditorPropertyDescription>
</IgbPropertyEditorPanel>
</div>
<div class="legend-title">
Highest Grossing Movie Franchises
</div>
<div class="legend">
<IgbLegend
Name="legend"
@ref="legend"
Orientation="LegendOrientation.Horizontal">
</IgbLegend>
</div>
<div class="container vertical fill">
<IgbCategoryChart
Name="chart"
@ref="chart"
DataSource="HighestGrossingMovies"
ChartType="CategoryChartType.Column"
CrosshairsSnapToData="true"
IsHorizontalZoomEnabled="false"
IsVerticalZoomEnabled="false"
XAxisInterval="1"
XAxisOverlap="1">
</IgbCategoryChart>
</div>
</div>
@code {
private Action BindElements { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var legend = this.legend;
var propertyEditorPanel1 = this.propertyEditorPanel1;
var xAxisOverlap = this.xAxisOverlap;
var chart = this.chart;
this.BindElements = () => {
propertyEditorPanel1.Target = this.chart;
};
this.BindElements();
}
private IgbLegend legend;
private IgbPropertyEditorPanel propertyEditorPanel1;
private IgbPropertyEditorPropertyDescription xAxisOverlap;
private IgbCategoryChart chart;
private HighestGrossingMovies _highestGrossingMovies = null;
public HighestGrossingMovies HighestGrossingMovies
{
get
{
if (_highestGrossingMovies == null)
{
_highestGrossingMovies = new HighestGrossingMovies();
}
return _highestGrossingMovies;
}
}
}
razor/*
CSS styles are loaded from the shared CSS file located at:
https://static.infragistics.com/xplatform/css/samples/
*/
css
その他のリソース
関連するチャート機能の詳細については、以下のトピックを参照してください。
API リファレンス
以下は、上記のセクションで説明した API メンバーのリストです。