main
syneffort 1 year ago
parent c73e34f622
commit 93665353c2
  1. 17
      LC_Tutorial/Tutorial/BasicPlots/GeoMapWindow.xaml
  2. 66
      LC_Tutorial/Tutorial/BasicPlots/GeoMapWindow.xaml.cs
  3. 3
      LC_Tutorial/Tutorial/MainWindow.xaml
  4. 6
      LC_Tutorial/Tutorial/MainWindow.xaml.cs
  5. 87
      LC_Tutorial/Tutorial/Resource.Designer.cs
  6. 124
      LC_Tutorial/Tutorial/Resource.resx
  7. 894
      LC_Tutorial/Tutorial/Resources/World.xml
  8. 25
      LC_Tutorial/Tutorial/Tutorial.csproj

@ -0,0 +1,17 @@
<Window x:Class="Tutorial.BasicPlots.GeoMapWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tutorial.BasicPlots"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
Title="GeoMapWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<lvc:GeoMap x:Name="chtGeo" Grid.Row="0" HeatMap="{Binding Values}" Source="./Resources/World.xml" LanguagePack="{Binding LanguagePack}" Margin="5" EnableZoomingAndPanning="True"/>
</Grid>
</Window>

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Tutorial.BasicPlots
{
/// <summary>
/// GeoMapWindow.xaml에 대한 상호 작용 논리
/// </summary>
public partial class GeoMapWindow : Window
{
public Dictionary<string, string> LanguagePack { get; set; }
public Dictionary<string, double> Values { get; set; }
public GeoMapWindow()
{
InitializeComponent();
InitInstance();
}
protected virtual void InitInstance()
{
Random rand = new Random();
Values = new Dictionary<string, double>();
Values["MX"] = rand.Next(0, 100);
Values["CA"] = rand.Next(0, 100);
Values["US"] = rand.Next(0, 100);
Values["IN"] = rand.Next(0, 100);
Values["CN"] = rand.Next(0, 100);
Values["JP"] = rand.Next(0, 100);
Values["KR"] = rand.Next(0, 100);
Values["BR"] = rand.Next(0, 100);
Values["DE"] = rand.Next(0, 100);
Values["FR"] = rand.Next(0, 100);
Values["GB"] = rand.Next(0, 100);
LanguagePack = new Dictionary<string, string>();
LanguagePack["KR"] = "Korean";
LanguagePack["MX"] = "México";
DataContext = this;
}
private void btnRandomize_Click(object sender, RoutedEventArgs e)
{
Random rand = new Random();
foreach (var pair in Values)
{
Values[pair.Key] = rand.Next(0, 100);
}
}
}
}

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tutorial" xmlns:local="clr-namespace:Tutorial"
mc:Ignorable="d" mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"> Title="MainWindow" Height="500" Width="800">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
@ -28,6 +28,7 @@
<Button x:Name="btnSolidGauge" Content="Solid Gauge" Margin="3" Click="btnSolidGauge_Click"/> <Button x:Name="btnSolidGauge" Content="Solid Gauge" Margin="3" Click="btnSolidGauge_Click"/>
<Button x:Name="btnAngularGauge" Content="Angular Gauge" Margin="3" Click="btnAngularGauge_Click"/> <Button x:Name="btnAngularGauge" Content="Angular Gauge" Margin="3" Click="btnAngularGauge_Click"/>
<Button x:Name="btnHeatMap" Content="Heat Map" Margin="3" Click="btnHeatMap_Click"/> <Button x:Name="btnHeatMap" Content="Heat Map" Margin="3" Click="btnHeatMap_Click"/>
<Button x:Name="btnGeoMap" Content="Geo Map" Margin="3" Click="btnGeoMap_Click"/>
</StackPanel> </StackPanel>
</TabItem> </TabItem>
</TabControl> </TabControl>

@ -109,5 +109,11 @@ namespace Tutorial
HeatMapWindow win = new HeatMapWindow(); HeatMapWindow win = new HeatMapWindow();
win.Show(); win.Show();
} }
private void btnGeoMap_Click(object sender, RoutedEventArgs e)
{
GeoMapWindow win = new GeoMapWindow();
win.Show();
}
} }
} }

@ -0,0 +1,87 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 도구를 사용하여 생성되었습니다.
// 런타임 버전:4.0.30319.42000
//
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
// 이러한 변경 내용이 손실됩니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Tutorial {
using System;
/// <summary>
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
/// </summary>
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
// 클래스에서 자동으로 생성되었습니다.
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resource() {
}
/// <summary>
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tutorial.Resource", typeof(Resource).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
/// 재정의합니다.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;!--
/// (c) lvcharts.net
/// Map Version 1.0
/// This work is licensed under a Creative Commons
/// Attribution-NonCommercial-ShareAlike 4.0 International License
/// https://creativecommons.org/licenses/by-nc-sa/4.0/
///--&gt;
///&lt;LiveChartsMap xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
/// &lt;Height&gt;2592&lt;/Height&gt;
/// &lt;Width&gt;4008&lt;/Width&gt;
/// &lt;Shapes&gt;
/// &lt;MapShape&gt;
/// &lt;Id&gt;AF&lt;/Id&gt;
/// &lt;Name&gt;Afghanistan&lt;/Name&gt;
/// &lt;Path&gt;M2685,1419L2696,1[나머지 문자열은 잘림]&quot;;과(와) 유사한 지역화된 문자열을 찾습니다.
/// </summary>
internal static string World {
get {
return ResourceManager.GetString("World", resourceCulture);
}
}
}
}

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="World" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\World.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>

File diff suppressed because one or more lines are too long

@ -7,8 +7,33 @@
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="Resources\World.xml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="LiveCharts.Wpf.Core" Version="0.9.8" /> <PackageReference Include="LiveCharts.Wpf.Core" Version="0.9.8" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\World.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Update="Resource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project> </Project>

Loading…
Cancel
Save