Skip to content

Commit 66d14a8

Browse files
auto sync for version 2023.2
1 parent 575353d commit 66d14a8

25 files changed

+255
-253
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,50 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Microsoft.NET.Sdk.Web">
3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="22.2.2" />
8-
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112.2" />
9-
<PackageReference Include="BuildBundlerMinifier" Version="3.2.447" />
10-
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.76" />
11-
</ItemGroup>
12-
<ItemGroup>
13-
<Compile Remove="node_modules\**" />
14-
<Content Remove="node_modules\**" />
15-
<EmbeddedResource Remove="node_modules\**" />
16-
<None Remove="node_modules\**" />
17-
</ItemGroup>
18-
<ItemGroup>
19-
<None Update="Data\Dashboards\ChartConstantLines.xml">
20-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21-
</None>
22-
<None Update="Data\Dashboards\ChartLineOptions.xml">
23-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24-
</None>
25-
<None Update="Data\Dashboards\ChartMaxAxisValue.xml">
26-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27-
</None>
28-
<None Update="Data\Dashboards\ChartScaleBreaks.xml">
29-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30-
</None>
31-
<None Update="Data\Dashboards\DashboardItemDescription.xml">
32-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33-
</None>
34-
<None Update="Data\Dashboards\ItemDescription.xml">
35-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
36-
</None>
37-
<None Update="Data\nwind.db">
38-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39-
</None>
40-
</ItemGroup>
41-
<Target Name="DebugEnsureNodeEnv" BeforeTargets="LibraryManagerRestore" Condition=" '$(Configuration)' == 'Debug' And !Exists('node_modules') ">
42-
<!-- Ensure Node.js is installed -->
43-
<Exec Command="node --version" ContinueOnError="true">
44-
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
45-
</Exec>
46-
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
47-
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
48-
<Exec WorkingDirectory="." Command="npm install" />
49-
</Target>
50-
</Project>
51-
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk.Web">
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="DevExpress.AspNetCore.Dashboard" Version="23.2.*-*" />
8+
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112.2" />
9+
<PackageReference Include="BuildBundlerMinifier" Version="3.2.447" />
10+
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.76" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<Compile Remove="node_modules\**" />
14+
<Content Remove="node_modules\**" />
15+
<EmbeddedResource Remove="node_modules\**" />
16+
<None Remove="node_modules\**" />
17+
</ItemGroup>
18+
<ItemGroup>
19+
<None Update="Data\Dashboards\ChartConstantLines.xml">
20+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
21+
</None>
22+
<None Update="Data\Dashboards\ChartLineOptions.xml">
23+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24+
</None>
25+
<None Update="Data\Dashboards\ChartMaxAxisValue.xml">
26+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27+
</None>
28+
<None Update="Data\Dashboards\ChartScaleBreaks.xml">
29+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30+
</None>
31+
<None Update="Data\Dashboards\DashboardItemDescription.xml">
32+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
</None>
34+
<None Update="Data\Dashboards\ItemDescription.xml">
35+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
36+
</None>
37+
<None Update="Data\nwind.db">
38+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39+
</None>
40+
</ItemGroup>
41+
<Target Name="DebugEnsureNodeEnv" BeforeTargets="LibraryManagerRestore" Condition=" '$(Configuration)' == 'Debug' And !Exists('node_modules') ">
42+
<!-- Ensure Node.js is installed -->
43+
<Exec Command="node --version" ContinueOnError="true">
44+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
45+
</Exec>
46+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
47+
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
48+
<Exec WorkingDirectory="." Command="npm install" />
49+
</Target>
50+
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-

2-
using DevExpress.DashboardCommon;
3-
using DevExpress.DashboardCommon.ViewerData;
4-
using DevExpress.DashboardWeb;
5-
using DevExpress.XtraCharts;
6-
using DevExpress.XtraReports.UI;
7-
using Newtonsoft.Json;
8-
using System.Collections.Generic;
9-
using System.Drawing;
10-
using System.Linq;
11-
12-
namespace AspNetCoreDashboardCustomPropertiesSample {
13-
public class CustomConstantLine {
14-
public int key { get; set; }
15-
public string name { get; set; }
16-
public bool isBound { get; set; }
17-
public string measureId { get; set; }
18-
public double value { get; set; }
19-
public string color { get; set; }
20-
public string labelText { get; set; }
21-
}
22-
23-
public static class ChartConstantLinesExtension {
24-
public static void CustomExport(CustomExportWebEventArgs e) {
25-
Dictionary<string, XRControl> controls = e.GetPrintableControls();
26-
foreach(var control in controls) {
27-
string componentName = control.Key;
28-
XRChart chartControl = control.Value as XRChart;
29-
ChartDashboardItem chartItem = e.GetDashboardItem(componentName) as ChartDashboardItem;
30-
if(chartControl != null && chartItem != null) {
31-
string constantLinesJSON = chartItem.CustomProperties["ConstantLineSettings"];
32-
if(constantLinesJSON != null) {
33-
XYDiagram diagram = chartControl.Diagram as XYDiagram;
34-
if(diagram != null) {
35-
List<CustomConstantLine> customConstantLines = JsonConvert.DeserializeObject<List<CustomConstantLine>>(constantLinesJSON);
36-
customConstantLines.ForEach(customConstantLine =>
37-
{
38-
ConstantLine line = new ConstantLine();
39-
line.Visible = true;
40-
line.ShowInLegend = false;
41-
//line.Color = ColorTranslator.FromHtml(customConstantLine.color);
42-
line.Title.Text = customConstantLine.labelText;
43-
line.LineStyle.DashStyle = DashStyle.Dash;
44-
line.LineStyle.Thickness = 2;
45-
if(customConstantLine.isBound) {
46-
MultiDimensionalData data = e.GetItemData(componentName);
47-
MeasureDescriptor measure = data.GetMeasures().FirstOrDefault(m => m.ID == customConstantLine.measureId);
48-
if(measure != null)
49-
line.AxisValue = data.GetValue(measure).Value;
50-
} else
51-
line.AxisValue = customConstantLine.value;
52-
53-
54-
if(diagram.SecondaryAxesY.Count > 0)
55-
diagram.SecondaryAxesY[0].ConstantLines.Add(line);
56-
});
57-
}
58-
}
59-
}
60-
}
61-
}
62-
}
63-
}
1+
2+
using DevExpress.DashboardCommon;
3+
using DevExpress.DashboardCommon.ViewerData;
4+
using DevExpress.DashboardWeb;
5+
using DevExpress.XtraCharts;
6+
using DevExpress.XtraReports.UI;
7+
using Newtonsoft.Json;
8+
using System.Collections.Generic;
9+
using System.Drawing;
10+
using System.Linq;
11+
12+
namespace AspNetCoreDashboardCustomPropertiesSample {
13+
public class CustomConstantLine {
14+
public int key { get; set; }
15+
public string name { get; set; }
16+
public bool isBound { get; set; }
17+
public string measureId { get; set; }
18+
public double value { get; set; }
19+
public string color { get; set; }
20+
public string labelText { get; set; }
21+
}
22+
23+
public static class ChartConstantLinesExtension {
24+
public static void CustomExport(CustomExportWebEventArgs e) {
25+
Dictionary<string, XRControl> controls = e.GetPrintableControls();
26+
foreach(var control in controls) {
27+
string componentName = control.Key;
28+
XRChart chartControl = control.Value as XRChart;
29+
ChartDashboardItem chartItem = e.GetDashboardItem(componentName) as ChartDashboardItem;
30+
if(chartControl != null && chartItem != null) {
31+
string constantLinesJSON = chartItem.CustomProperties["ConstantLineSettings"];
32+
if(constantLinesJSON != null) {
33+
XYDiagram diagram = chartControl.Diagram as XYDiagram;
34+
if(diagram != null) {
35+
List<CustomConstantLine> customConstantLines = JsonConvert.DeserializeObject<List<CustomConstantLine>>(constantLinesJSON);
36+
customConstantLines.ForEach(customConstantLine =>
37+
{
38+
ConstantLine line = new ConstantLine();
39+
line.Visible = true;
40+
line.ShowInLegend = false;
41+
//line.Color = ColorTranslator.FromHtml(customConstantLine.color);
42+
line.Title.Text = customConstantLine.labelText;
43+
line.LineStyle.DashStyle = DashStyle.Dash;
44+
line.LineStyle.Thickness = 2;
45+
if(customConstantLine.isBound) {
46+
MultiDimensionalData data = e.GetItemData(componentName);
47+
MeasureDescriptor measure = data.GetMeasures().FirstOrDefault(m => m.ID == customConstantLine.measureId);
48+
if(measure != null)
49+
line.AxisValue = data.GetValue(measure).Value;
50+
} else
51+
line.AxisValue = customConstantLine.value;
52+
53+
54+
if(diagram.SecondaryAxesY.Count > 0)
55+
diagram.SecondaryAxesY[0].ConstantLines.Add(line);
56+
});
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}

CS/AspNetCoreDashboard/Models/DefaultDashboardController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using DevExpress.DashboardAspNetCore;
1+
using DevExpress.DashboardAspNetCore;
22
using DevExpress.DashboardWeb;
33
using Microsoft.AspNetCore.DataProtection;
44

0 commit comments

Comments
 (0)