diff --git a/README.md b/README.md index c6cd1ec..48ef92e 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,28 @@ The screenshot of Bar Chart Race Generator The more complete documentation can be read in the [Bar Chart Race Website](https://yoyokits.github.io/BarChartRaceNet/). -{% include youtube_embed.html id="Xtnz7N6mwX4" %} -The video example of Bar Chart Race output +The video example of Bar Chart Race output: [Youtube example](https://www.youtube.com/watch?v=onQ0V4cIgMQ) -The input of for this application is CVS files that can be exported from your Excell sheet or simply created using Notepad.
+The input of for this application is CSV files that can be exported from your Excell sheet or simply created using Notepad.
-The CVS example can be downloaded from [CVS example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples). +The CVS example can be downloaded from [CSV example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples). -The cvs file is like: +The CSV file is like:
+ +Installation:
+1. [Download the latest release in zip file.](https://github.com/yoyokits/BarChartRaceNet/releases) +2. Extract the zip file in the Program Files or your favourite folder +3. Simply double click BarChartRaceNet.exe + +Usages: +1. Double click BarChartRaceNet.exe +2. Click load button on the top left of the window +3. Select the csv file with format above +4. Adjust the settings like add icon for every bar and background +5. Generate the bar chart race animation in a MPEG format by clicking Export to Video button on the right side of load button +6. Select the output folder and file name and press Save +7. Wait until the process is done + +If you have a problem please ask me in [Facebook StatAnim Page](https://www.facebook.com/StatAnim-106525391163002) or open an issue here. diff --git a/docs/index.md b/docs/index.md index ca1f115..3fa32df 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,13 +6,13 @@ Bar Chart Race is a free application used to visualize the progress of some deve The screenshot of Bar Chart Race Generator {% include youtube_embed.html id="Xtnz7N6mwX4" %} -The video example of Bar Chart Race output +The video example of Bar Chart Race output: [Youtube example](https://www.youtube.com/watch?v=onQ0V4cIgMQ) -The input of for this application is CVS files that can be exported from your Excell sheet or simply created using Notepad.
+The input of for this application is CSV files that can be exported from your Excell sheet or simply created using Notepad.
-The CVS example can be downloaded from [CVS example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples). +The CSV example can be downloaded from [CSV example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples). -The cvs file is like: +The CSV file is like:
@@ -29,3 +29,5 @@ Usages: 5. Generate the bar chart race animation in a MPEG format by clicking Export to Video button on the right side of load button 6. Select the output folder and file name and press Save 7. Wait until the process is done + +If you have a problem please ask me in [Facebook StatAnim Page](https://www.facebook.com/StatAnim-106525391163002) or open an issue here. \ No newline at end of file diff --git a/src/BarChartRaceNet.Test/BarChartRaceNet.Test.csproj b/src/BarChartRaceNet.Test/BarChartRaceNet.Test.csproj index b40dad6..f3ec726 100644 --- a/src/BarChartRaceNet.Test/BarChartRaceNet.Test.csproj +++ b/src/BarChartRaceNet.Test/BarChartRaceNet.Test.csproj @@ -11,7 +11,15 @@ key.snk - 0.1.0 + 0.1.0.1 + + https://github.com/yoyokits/BarChartRaceNet + + Cekli + + https://github.com/yoyokits/BarChartRaceNet + + git @@ -33,11 +41,14 @@ - + - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/BarChartRaceNet/BarChartRaceNet.csproj b/src/BarChartRaceNet/BarChartRaceNet.csproj index 4dbe631..181e639 100644 --- a/src/BarChartRaceNet/BarChartRaceNet.csproj +++ b/src/BarChartRaceNet/BarChartRaceNet.csproj @@ -7,6 +7,11 @@ AnyCPU;x64 true key.snk + 0.1.0.1 + Cekli + https://github.com/yoyokits/BarChartRaceNet + https://github.com/yoyokits/BarChartRaceNet + git @@ -18,10 +23,10 @@ - - + + - + diff --git a/src/BarChartRaceNet/Helpers/FFMpegHelper.cs b/src/BarChartRaceNet/Helpers/FFMpegHelper.cs index adc5e3e..293a235 100644 --- a/src/BarChartRaceNet/Helpers/FFMpegHelper.cs +++ b/src/BarChartRaceNet/Helpers/FFMpegHelper.cs @@ -20,6 +20,27 @@ /// public static class FFMpegHelper { + #region Properties + + /// + /// Gets the FFMpegLib. + /// + public static string FFMpegLib { get; } = "ffmpeg.exe"; + + /// + /// Gets a value indicating whether IsFFMpegLibExist. + /// + public static bool IsFFMpegLibExist + { + get + { + var exist = File.Exists(FFMpegLib); + return exist; + } + } + + #endregion Properties + #region Methods /// diff --git a/src/BarChartRaceNet/Helpers/SettingsHelper.cs b/src/BarChartRaceNet/Helpers/SettingsHelper.cs index d3f8deb..fa90ce5 100644 --- a/src/BarChartRaceNet/Helpers/SettingsHelper.cs +++ b/src/BarChartRaceNet/Helpers/SettingsHelper.cs @@ -70,7 +70,7 @@ public static string GetImageUrl(this IDictionary stringToImageU /// The . internal static SettingsModel Load() { - Logger.Info($"Loading Browser setting {UserJsonSettingsPath}"); + Logger.Info($"Loading {AppEnvironment.LongName} setting {UserJsonSettingsPath}"); if (!File.Exists(UserJsonSettingsPath)) { return null; @@ -87,7 +87,7 @@ internal static SettingsModel Load() } catch (Exception e) { - Logger.Error($"Error Loading Browser Setting: {e.Message}"); + Logger.Error($"Error Loading {AppEnvironment.LongName} Setting: {e.Message}"); } return null; diff --git a/src/BarChartRaceNet/Models/SettingsModel.cs b/src/BarChartRaceNet/Models/SettingsModel.cs index 7ef3692..90bc2ce 100644 --- a/src/BarChartRaceNet/Models/SettingsModel.cs +++ b/src/BarChartRaceNet/Models/SettingsModel.cs @@ -55,7 +55,7 @@ public class SettingsModel /// /// Gets or sets the DecimalPlaces. /// - public int DecimalPlaces { get; set; } + public int DecimalPlaces { get; set; } = 3; /// /// Gets or sets the InitialDirectory. diff --git a/src/BarChartRaceNet/ViewModels/ChartEditorViewModel.cs b/src/BarChartRaceNet/ViewModels/ChartEditorViewModel.cs index aecde41..d347faa 100644 --- a/src/BarChartRaceNet/ViewModels/ChartEditorViewModel.cs +++ b/src/BarChartRaceNet/ViewModels/ChartEditorViewModel.cs @@ -100,8 +100,17 @@ internal void CancelRendering() /// /// The OnExportChart. /// - internal void ExportChart() + internal async void ExportChart() { + if (!FFMpegHelper.IsFFMpegLibExist) + { + var title = $"FFMpeg Library {FFMpegHelper.FFMpegLib} Not Found"; + var message = $"Please download {FFMpegHelper.FFMpegLib} from https://ffbinaries.com/downloads," + + $" extract and copy to the application path."; + await this.GlobalData.ShowMessageAsync(title, message); + return; + } + var fileName = $"{this.BarChartViewModel.Title}.mp4"; var dialog = new VistaSaveFileDialog { @@ -123,7 +132,7 @@ internal void ExportChart() this.RenderCancellationTokenSource?.Cancel(); this.RenderCancellationTokenSource = new CancellationTokenSource(); var token = this.RenderCancellationTokenSource.Token; - Task.Run(() => + await Task.Run(async () => { try { @@ -131,7 +140,7 @@ internal void ExportChart() } catch (Exception e) { - this.GlobalData.ShowMessageAsync($"Export Failed", $"Error: {e.Message}"); + await this.GlobalData.ShowMessageAsync($"Export Failed", $"Error: {e.Message}\r\n{e.StackTrace}"); } }, token); } diff --git a/src/BarChartRaceNet/ViewModels/MainWindowViewModel.cs b/src/BarChartRaceNet/ViewModels/MainWindowViewModel.cs index 64ca1cd..da63862 100644 --- a/src/BarChartRaceNet/ViewModels/MainWindowViewModel.cs +++ b/src/BarChartRaceNet/ViewModels/MainWindowViewModel.cs @@ -8,6 +8,7 @@ using System; using System.Collections.ObjectModel; using System.IO; + using System.Threading.Tasks; using System.Windows; using System.Windows.Input; @@ -113,8 +114,11 @@ private void OnClosing(object obj) /// private void OnExportChart() { - this.CancelRenderingButton.IsEnabled = true; - this.ChartEditorViewModel.ExportChart(); + Task.Run(() => + { + this.CancelRenderingButton.IsEnabled = true; + this.ChartEditorViewModel.ExportChart(); + }); } /// diff --git a/src/BarChartRaceNetTestApp/BarChartRaceNetTestApp.csproj b/src/BarChartRaceNetTestApp/BarChartRaceNetTestApp.csproj index 66d5db8..603e980 100644 --- a/src/BarChartRaceNetTestApp/BarChartRaceNetTestApp.csproj +++ b/src/BarChartRaceNetTestApp/BarChartRaceNetTestApp.csproj @@ -4,10 +4,14 @@ WinExe netcoreapp3.1 true - 0.1.0 + 0.1.0.1 AnyCPU;x64 true key.snk + Cekli + https://github.com/yoyokits/BarChartRaceNet + https://github.com/yoyokits/BarChartRaceNet + git @@ -29,7 +33,7 @@ - +