Excel Chart range not updating - excel

I have created a chart which is dependent on a table of data, where the data range contracts and expands according to user input. There is a cell where the user can input how many months the chart range should be and the data table that the chart is connected to pulls the corresponding range of data from a different, master data table.
So my issue is that, when the chart data table contracts, the chart does not adjust. There is no issue with the chart data table expanding, only when the chart data table contracts, as it should be able to. The issue is even more strange because usually I can fiddle with a setting briefly and then the chart will update. For instance, i can go to Select Data on the chart and then hit cancel and the chart updates. Or I can change chart type to the same it already was, and the chart will update. So why is it that the chart does not initially update when the data in its range change?
Also, I would prefer to not use VBA on this due to the file sizes with which I am working. Is there a trick to getting this to work in Excel?
Below is an image of what I'm referring to:

Related

Adding or removing data from excel add ins charts

I am working on an excel add in, and need to show data in chart. I am facing a problem to set data for chart as it is not in a range. I am showing only first 10 columns in chart.
I am using WorkSheet.charts.add() function to add a new chart, however it takes data as range only. My x-axis is very first row of the sheet, but data for Y-Axis can be any row selected by user. For example if user selected row 7, then I cannot create a range from "A1:J1, A7:J7" as per my understanding range must be connected cells. If I create a range "A1:J7", it shows data of other rows and I am unable to find a way to remove/hide that data. I can do it manually using Chart options from menu, but cannot find a way to do so in API.
The technique for doing this is to copy the data that should be in the chart to a range on a hidden worksheet. Then pass that range to the Worksheet.charts.add() function. There is a sample add-in that shows how to do this: Excel Add-in JavaScript Sales Tracker.

Excel pie chart is blank after editing source data

I experienced a problem where the pie chart in Excel went completely blank because I edited the "source data" to include some blank rows. I expanded that source data because I thought it might be populated later. I needed a dynamic chart that would be able to include additional data.
Rather than using Index or Offset for a dynamic range (which didn't work for me), I found another solution which I would like share.
Instead of editing a pre-existing chart to increase its range to include blank rows, it is necessary to populate those blank rows with dummy data. Then make a new chart based on the range that includes this dummy data.
Now, by deleting the dummy data, the accepted range will still be intact in case real data is added at a later time.
The real problem appears to be how "select data" works on empty cells after a pie chart has been created.
For example:

EPPLUS - Charts not updating after table grows

I have an Excel file with a table and several charts created from data in the table. I need the charts to take any new data when the table grows. It works fine if I work from Excel, obviously (i.e. when I add a new row, the charts make room for the new data and when the numbers are added, the charts show the changes).
But I need to do it programmatically with Epplus. I've managed to add a row to the table and have it update all the formulae in it properly, but the charts are not updated.
Any idea of why this is? Is it a known limitation of EPPlus?
Or do I have to traverse all the charts and update the data series for each?

Dynamic charts from pivot

I have a data set that I am using as an input to a pivot table. I have transformed that data set into a table, so that every-time I add something to the data set, the pivot gets updated automatically. I have also added a line of code, so that every-time a user clicks on the sheet containing the pivot table, the table gets refreshed automatically. Now I need to have a chart (linked to the pivot table) that updates automatically every-time the pivot refreshes (like rows or columns also increase/decrease).
You could use a dynamic named range in order to get the chart data to update automatically. Without knowing what your data looks like, I'll just provide you with a generic version assuming your data is in A1:C5.
=OFFSET(A1;0;0;COUNT(A:A);3)
This will create a range that is 3 columns wide and goes until the last row with data in column A.

Structure Reference for Excel Pivot Table Column Labels for Named Range

I'm interested in creating a chart for which I can easily change the data source from which the chart is created. However, as I am hoping to grab this data from a pivot table (as I am using a Mac and cannot create pivot charts), I am having some difficulty constructing the named range.
The link below shows what I am hoping to do but with a pivot table rather than a normal table:
http://www.get-digital-help.com/2013/11/06/quickly-change-chart-data-source/#comment-66012
Is this possible? If so, how can I adapt the formulas given in the linked website to use with the pivot table?
Thank you in advance!
Goto Insert --> Pivot Chart
Select the data cells along with header. (Apply required formulas to your base data itself)
Choose existing or new worksheet as per your requirement.
Select the column labels and row labels and sigma values according to your requirement.
Automatically a pivot Bar graph would be generated. This will also have a default filter option where if you select particular values, the graph will automatically get changed.
If there are any modifications to data, just right click the pivot graph and click refresh Data.

Resources