Microcharts icon indicating copy to clipboard operation
Microcharts copied to clipboard

Line Chart does not expand to full width

Open dannmat opened this issue 6 years ago • 13 comments

Adding a line chart does not fill the full canvas space. Interestingly, adding more data points expands the chart closer to the edge of the canvas. From testing, it takes about 15-20 data points for the chart to look normal.

dannmat avatar Oct 30 '18 11:10 dannmat

Same problem here, couldn't manage to make the chart use the whole space all the time...

ronaldosena avatar Nov 07 '18 18:11 ronaldosena

Since this seems to be a stale repo (and the best option out there), I've forked it and will continue to maintain it myself -> https://github.com/Nixon-Joseph/Microcharts. I don't have the nuget package built yet (11/14/2018), but plan to by end of day.

I am a busy person, so likely won't be able to address issues immediately, but am fully supportive of forks and support. I do plan on fixing what I can when I can.

Nixon-Joseph avatar Nov 14 '18 14:11 Nixon-Joseph

That's brilliant, its a great library that needed someone to upkeep it!

dannmat avatar Nov 15 '18 08:11 dannmat

If you wouldn't mind, could you recreate any bugs that you're currently struggling with in my fork? I'll do my best to keep up, and handle everything.

Nixon-Joseph avatar Nov 15 '18 12:11 Nixon-Joseph

@dannmat it actually appears that I might possibly be joining the creator to collaborate on this repo, so I'd hold off on duplicating your issues on my fork for a bit.

Nixon-Joseph avatar Nov 15 '18 18:11 Nixon-Joseph

Ok that's fine, let me know if you need me to though 👍

dannmat avatar Nov 16 '18 21:11 dannmat

@Nixon-Joseph ur branch is private?

lucas-zimerman avatar Jan 14 '19 15:01 lucas-zimerman

@ibm5155 no, since being added as a contributor, I removed my branch. Sorry, I haven't been any more attentive than the original owner. I'll be working on that. There are several features and re-works that were in process on other branches of this repo that I was unaware of when I started playing with it, and many of those branches have fixing changes to a lot of the issues. I'm going to work on implementing them in the main release as soon as I can.

Nixon-Joseph avatar Jan 24 '19 17:01 Nixon-Joseph

@dannmat Can you please provide a small code sample or repro so that I can test and fix this efficiently? Thanks!

Nixon-Joseph avatar Jul 27 '19 03:07 Nixon-Joseph

Hi @Nixon-Joseph

Here's an example, running Microcharts 0.7.1:

public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            CreateChart();
        }

        public void CreateChart()
        {
            var entries = new[]
            {
                new Microcharts.Entry(200)
                {
                    Label = "January",
                    ValueLabel = "200"
                },
                new Microcharts.Entry(400)
                {
                    Label = "February",
                    ValueLabel = "400"
                },
                new Microcharts.Entry(-100)
                {
                    Label = "March",
                    ValueLabel = "-100"
                }
            };

            var chart = new BarChart() { Entries = entries };

            this.chartView.Chart = chart;
        }
    }

Xaml side:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Microcharts_Test"
             xmlns:microcharts="clr-namespace:Microcharts.Forms;assembly=Microcharts.Forms"
             x:Class="Microcharts_Test.MainPage">

    <StackLayout>
        <microcharts:ChartView x:Name="chartView" />
    </StackLayout>

</ContentPage>

dannmat avatar Jul 29 '19 07:07 dannmat

I'm facing the same problem when we have 3 or less entry in Series

jigneshbodarya avatar Jan 09 '22 04:01 jigneshbodarya

This bug appears to be located in the method CalculatePoints in class PointChart. I'm going to try and get it to fill without margins so we can boxview hashmarks into the line graph like I have it here: image

SamuelKraus avatar Feb 02 '22 21:02 SamuelKraus

any updates here ?

uwe-neuronation avatar Sep 28 '22 14:09 uwe-neuronation