Custom Table Widget
Hi Folks,
I am creating a table widget where I want the columns to be all the Products and then the y axis to the be the Quarters. So it would show how many products where sold in each quarter with a total count at the very bottom. The relationships are in place where I should be able to pull in the data for sales per quarter Product->sales($quarter), but i cant figure out how to correctly pull in the columns as all the products and set the rows as q1, q2, q3, q4.
Is this do able with table builder or is there is a better way I should be achieving this kind of a layout? I figure this something people are often doing so it shouldn't be too hard, but maybe I'm overcomplicating it myself.
Thanks!
Solution:Jump to solution
Hmm, not really going to be able to do that out of the box since tables require eloquent queries. You could possible do it faking a model and using the sushi package.
5 Replies
What do you mean by ‘y axis’ tables don’t have axis’
Sorry poor word choice there. First Column would be "Quarters" and then following columsn would be "Product 1" Product 2" and so on. Then The Row 1 would be Q1 an 100, 200, and so on
We dont have a ton of products so in theory it would be 5 columns
Solution
Hmm, not really going to be able to do that out of the box since tables require eloquent queries. You could possible do it faking a model and using the sushi package.
I do think that what you are trying to represent is actually better served as a chart widget though.
You could always just do a custom widget with a custom view and just render it as an html table. Don’t need the table builder for that.
Okay that was my next question, just render it using a custom view as opposed to using table builder
Looking at the chart widget I'm just not sure which I'd use. It's not really a bar graph
Appreciate you help. How I go about generating a custom widget that just returns a view that I can pass my model too?
Nevermind I see it now 🙂