Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to instantiate SKGeoMap #1499

Open
mjanulaitis opened this issue Apr 28, 2024 · 0 comments
Open

Unable to instantiate SKGeoMap #1499

mjanulaitis opened this issue Apr 28, 2024 · 0 comments

Comments

@mjanulaitis
Copy link

The bug
I have a background WPF process that generates images for email notifications and scheduled reports. Currently I am able to generate line, bar, pie and stacked charts however when I try to create an SKGeoMap to create the chart so I can then call the SaveImage method and error is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Instantiate the following class:
    public class GeoMapChartControlEx
    {
        private ObservableCollection<HeatLandSeries> SeriesCollection { get; set; } = new();

        private readonly SKGeoMap chartCtrl = new();

        public GeoMapChartControlEx()
        {
            chartCtrl.Series = SeriesCollection;
        }

        public void SaveImage(ChartModel m, string outputFileName)
        {
            try
            {
                chartCtrl.Width = m.ChartOptionsModel.Width;
                chartCtrl.Height = m.ChartOptionsModel.Height;

                chartCtrl.CreateChart(m, SeriesCollection);
                chartCtrl.SaveImage(outputFileName);
            }
            catch (Exception ex)
            {
                MainViewModel.Instance.Log(ex);
            }
        }
    }
  1. The following error is thrown: There is no a ChartEngine registered.

Expected behavior
The ChartEngine should registered and the class successfully instantiated.

Desktop (please complete the following information):

  • OS: Windows 11
  • .Net 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant